Skip to content

Commit 60fbb4d

Browse files
committed
Simplify cost_incremental_sort a bit
Commit de0dc1a added code to cost_incremental_sort to handle varno 0. Explicitly removing the RelabelType is not really necessary, because the pull_varnos handles that just fine, which simplifies the code a bit. Author: Richard Guo Discussion: https://postgr.es/m/CAMbWs4_3_D2J5XxOuw68hvn0-gJsw9FXNSGcZka9aTymn9UJ8A%40mail.gmail.com Discussion: https://postgr.es/m/20200411214639.GK2228%40telsasoft.com
1 parent 2e08d31 commit 60fbb4d

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-
Relids varnos;
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy