aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpython.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-03-27 19:06:14 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-03-27 19:06:14 +0000
commitff72280c9ee35bf67c9b711837594fde29b86c4d (patch)
tree8054768c8515c7d3770290c02058f91c3ee6b48d /src/pl/plpython/plpython.c
parent39627b1ae680cba44f6e56ca5facec4fdbfe9495 (diff)
downloadpostgresql-ff72280c9ee35bf67c9b711837594fde29b86c4d.tar.gz
postgresql-ff72280c9ee35bf67c9b711837594fde29b86c4d.zip
When we have successfully optimized a MIN or MAX aggregate into an indexscan,
the query result must be exactly one row (since we don't do this when there's any GROUP BY). Therefore any ORDER BY or DISTINCT attached to the query is useless and can be dropped. Aside from saving useless cycles, this protects us against problems with matching the hacked-up tlist entries to sort clauses, as seen in a bug report from Taiki Yamaguchi. We might need to work harder if we ever try to optimize grouped queries with this approach, but this solution will do for now.
Diffstat (limited to 'src/pl/plpython/plpython.c')
0 files changed, 0 insertions, 0 deletions