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

Commit07746a8

Browse files
committed
Finish incomplete revert ofec63622.
The code change this made might well be fine to keep, but thecomment justifying it by reference to self-join removal isn't.Let's just go back to the status quo ante, pending a more thoroughreview/redesign of SJE.(I found this by grepping to see if any references to self-joinremoval remained in the tree.)
1 parent521a715 commit07746a8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎src/backend/optimizer/prep/prepunion.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -662,17 +662,14 @@ build_setop_child_paths(PlannerInfo *root, RelOptInfo *rel,
662662
* otherwise do statistical estimation.
663663
*
664664
* XXX you don't really want to know about this: we do the estimation
665-
* using thesubroot->parse's original targetlist expressions, not the
665+
* using thesubquery's original targetlist expressions, not the
666666
* subroot->processed_tlist which might seem more appropriate. The reason
667667
* is that if the subquery is itself a setop, it may return a
668668
* processed_tlist containing "varno 0" Vars generated by
669669
* generate_append_tlist, and those would confuse estimate_num_groups
670670
* mightily. We ought to get rid of the "varno 0" hack, but that requires
671671
* a redesign of the parsetree representation of setops, so that there can
672-
* be an RTE corresponding to each setop's output. Note, we use this not
673-
* subquery's targetlist but subroot->parse's targetlist, because it was
674-
* revised by self-join removal. subquery's targetlist might contain the
675-
* references to the removed relids.
672+
* be an RTE corresponding to each setop's output.
676673
*/
677674
if (pNumGroups)
678675
{
@@ -685,7 +682,7 @@ build_setop_child_paths(PlannerInfo *root, RelOptInfo *rel,
685682
*pNumGroups=rel->cheapest_total_path->rows;
686683
else
687684
*pNumGroups=estimate_num_groups(subroot,
688-
get_tlist_exprs(subroot->parse->targetList, false),
685+
get_tlist_exprs(subquery->targetList, false),
689686
rel->cheapest_total_path->rows,
690687
NULL,
691688
NULL);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp