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

Commit60fbb4d

Browse files
committed
Simplify cost_incremental_sort a bit
Commitde0dc1a added code to cost_incremental_sort to handle varno 0.Explicitly removing the RelabelType is not really necessary, because thepull_varnos handles that just fine, which simplifies the code a bit.Author: Richard GuoDiscussion:https://postgr.es/m/CAMbWs4_3_D2J5XxOuw68hvn0-gJsw9FXNSGcZka9aTymn9UJ8A%40mail.gmail.comDiscussion:https://postgr.es/m/20200411214639.GK2228%40telsasoft.com
1 parent2e08d31 commit60fbb4d

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,9 +1842,6 @@ cost_incremental_sort(Path *path,
18421842
*/
18431843
foreach(l,pathkeys)
18441844
{
1845-
Node*expr;
1846-
Relidsvarnos;
1847-
18481845
PathKey*key= (PathKey*)lfirst(l);
18491846
EquivalenceMember*member= (EquivalenceMember*)
18501847
linitial(key->pk_eclass->ec_members);
@@ -1853,14 +1850,7 @@ cost_incremental_sort(Path *path,
18531850
* Check if the expression contains Var with "varno 0" so that we
18541851
* don't call estimate_num_groups in that case.
18551852
*/
1856-
expr= (Node*)member->em_expr;
1857-
1858-
if (IsA(expr,RelabelType))
1859-
expr= (Node*) ((RelabelType*)expr)->arg;
1860-
1861-
varnos=pull_varnos(expr);
1862-
1863-
if (bms_is_member(0,varnos))
1853+
if (bms_is_member(0,pull_varnos((Node*)member->em_expr)))
18641854
{
18651855
unknown_varno= true;
18661856
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp