OSDN Git Service

Teach planner how to propagate pathkeys from sub-SELECTs in FROM up to
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Feb 2003 20:12:41 +0000 (20:12 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Feb 2003 20:12:41 +0000 (20:12 +0000)
commit056467ec6bcbd81a9d1480af8d641946a5ef1bff
tree9bcbdc5f6443cc045783a0e712fbab572eff0952
parent50c4190e370a66bc8c52a0985cebf5560b28b058
Teach planner how to propagate pathkeys from sub-SELECTs in FROM up to
the outer query.  (The implementation is a bit klugy, but it would take
nontrivial restructuring to make it nicer, which this is probably not
worth.)  This avoids unnecessary sort steps in examples like
SELECT foo,count(*) FROM (SELECT ... ORDER BY foo,bar) sub GROUP BY foo
which means there is now a reasonable technique for controlling the
order of inputs to custom aggregates, even in the grouping case.
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/pathkeys.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/util/pathnode.c
src/backend/optimizer/util/relnode.c
src/backend/optimizer/util/tlist.c
src/include/optimizer/pathnode.h
src/include/optimizer/paths.h
src/include/optimizer/tlist.h