Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14661ba

Browse files
committed
Replace has_multiple_baserels() with a bitmap test on all_baserels.
Since we added the PlannerInfo.all_baserels set, it's not reallynecessary to grovel over the rangetable to count baserels in thecurrent query. So let's drop has_multiple_baserels() in favorof a bms_membership() test. This might be microscopicallyfaster, but the main point is to remove some unnecessary code.Richard GuoDiscussion:https://postgr.es/m/CAMbWs4_8RcSbbfs1ASZLrMuL0c0EQgXWcoLTQD8swBRY_pQQiA@mail.gmail.com
1 parent98e8974 commit14661ba

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

‎src/backend/optimizer/path/allpaths.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,28 +2190,6 @@ set_dummy_rel_pathlist(RelOptInfo *rel)
21902190
set_cheapest(rel);
21912191
}
21922192

2193-
/* quick-and-dirty test to see if any joining is needed */
2194-
staticbool
2195-
has_multiple_baserels(PlannerInfo*root)
2196-
{
2197-
intnum_base_rels=0;
2198-
Indexrti;
2199-
2200-
for (rti=1;rti<root->simple_rel_array_size;rti++)
2201-
{
2202-
RelOptInfo*brel=root->simple_rel_array[rti];
2203-
2204-
if (brel==NULL)
2205-
continue;
2206-
2207-
/* ignore RTEs that are "other rels" */
2208-
if (brel->reloptkind==RELOPT_BASEREL)
2209-
if (++num_base_rels>1)
2210-
return true;
2211-
}
2212-
return false;
2213-
}
2214-
22152193
/*
22162194
* find_window_run_conditions
22172195
*Determine if 'wfunc' is really a WindowFunc and call its prosupport
@@ -2661,7 +2639,7 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
26612639
root->hasHavingQual||
26622640
parse->distinctClause||
26632641
parse->sortClause||
2664-
has_multiple_baserels(root))
2642+
bms_membership(root->all_baserels)==BMS_MULTIPLE)
26652643
tuple_fraction=0.0;/* default case */
26662644
else
26672645
tuple_fraction=root->tuple_fraction;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp