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

Commit32fcfcd

Browse files
committed
Fix oversight in recent changes to enable the 'physical tlist'
optimization for subquery and function scan nodes: we can't just do itunconditionally, we still have to check whether there is any need fora whole-row Var. I had been thinking that these node types couldn'thave any system columns, which is true, but that loop is also checkingfor attno zero, ie, whole-row Var. Fix comment to not be so misleading.Per test case from Richard Huxton.
1 parentb33a732 commit32fcfcd

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.201 2005/10/15 02:49:20momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.202 2005/10/19 17:31:20tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -308,17 +308,13 @@ use_physical_tlist(RelOptInfo *rel)
308308
inti;
309309

310310
/*
311-
*OK for subquery and function scans; otherwise, can't do it for anything
312-
*except real relations.
311+
*We can do this for real relation scans, subquery scans, and function
312+
*scans (but not for, eg, joins).
313313
*/
314-
if (rel->rtekind!=RTE_RELATION)
315-
{
316-
if (rel->rtekind==RTE_SUBQUERY)
317-
return true;
318-
if (rel->rtekind==RTE_FUNCTION)
319-
return true;
314+
if (rel->rtekind!=RTE_RELATION&&
315+
rel->rtekind!=RTE_SUBQUERY&&
316+
rel->rtekind!=RTE_FUNCTION)
320317
return false;
321-
}
322318

323319
/*
324320
* Can't do it with inheritance cases either (mainly because Append
@@ -328,15 +324,16 @@ use_physical_tlist(RelOptInfo *rel)
328324
return false;
329325

330326
/*
331-
* Can't do it if any system columnsare requested, either. (This could
332-
* possibly be fixed but would take some fragile assumptions in setrefs.c,
333-
* I think.)
327+
* Can't do it if any system columnsor whole-row Vars are requested,
328+
*either. (This couldpossibly be fixed but would take some fragile
329+
*assumptions in setrefs.c,I think.)
334330
*/
335331
for (i=rel->min_attr;i <=0;i++)
336332
{
337333
if (!bms_is_empty(rel->attr_needed[i-rel->min_attr]))
338334
return false;
339335
}
336+
340337
return true;
341338
}
342339

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp