]> granicus.if.org Git - postgresql/commit
Improve planner's choices about when to use hashing vs sorting for DISTINCT.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Feb 2010 03:38:35 +0000 (03:38 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 10 Feb 2010 03:38:35 +0000 (03:38 +0000)
commit76b6ee3f380b90956a1ca18f15e2a70874651f66
tree6c2bbc7bfab237f7cf51b006f7698d2abf4a9085
parentcbe9d6beb4ae1cb20c08cab29b534be4923b6768
Improve planner's choices about when to use hashing vs sorting for DISTINCT.

The previous coding missed a bet by sometimes picking the "sorted" path
from query_planner even though hashing would be preferable.  To fix, we have
to be willing to make the choice sooner.  This contorts things a little bit,
but I thought of a factorization that makes it not too awful.
src/backend/optimizer/plan/planner.c