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

Commitf4abd02

Browse files
committed
Support flattening of empty-FROM subqueries and one-row VALUES tables.
We can't handle this in the general case due to limitations of theplanner's data representations; but we can allow it in many useful cases,by being careful to flatten only when we are pulling a single-row subqueryup into a FROM (or, equivalently, inner JOIN) node that will still have atleast one remaining relation child. Per discussion of an example fromKyotaro Horiguchi.
1 parentb746d0c commitf4abd02

File tree

9 files changed

+466
-71
lines changed

9 files changed

+466
-71
lines changed

‎src/backend/nodes/outfuncs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,7 @@ _outPlannerInfo(StringInfo str, const PlannerInfo *node)
17621762
WRITE_BOOL_FIELD(hasInheritedTarget);
17631763
WRITE_BOOL_FIELD(hasJoinRTEs);
17641764
WRITE_BOOL_FIELD(hasLateralRTEs);
1765+
WRITE_BOOL_FIELD(hasDeletedRTEs);
17651766
WRITE_BOOL_FIELD(hasHavingQual);
17661767
WRITE_BOOL_FIELD(hasPseudoConstantQuals);
17671768
WRITE_BOOL_FIELD(hasRecursion);

‎src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,7 @@ subquery_planner(PlannerGlobal *glob, Query *parse,
352352
* Check to see if any subqueries in the jointree can be merged into this
353353
* query.
354354
*/
355-
parse->jointree= (FromExpr*)
356-
pull_up_subqueries(root, (Node*)parse->jointree);
355+
pull_up_subqueries(root);
357356

358357
/*
359358
* If this is a simple UNION ALL query, flatten it into an appendrel. We

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp