OSDN Git Service

Avoid considering both sort directions as equally useful for merging.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 27 Oct 2007 05:45:43 +0000 (05:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 27 Oct 2007 05:45:43 +0000 (05:45 +0000)
commit834ddc6272943ed7075cbca9646fdacb3598a93d
tree4603483b26ce5210c7d52dda88acf3776f502f4f
parent5b5a70aedf133d847d92429e336b06a5fb4c5a2a
Avoid considering both sort directions as equally useful for merging.
This doubles the planning workload for mergejoins while not actually
accomplishing much.  The only useful case is where one of the directions
matches the query's ORDER BY request; therefore, put a thumb on the scales
in that direction, and otherwise arbitrarily consider only the ASC direction.
(This is a lot easier now than it would've been before 8.3, since we have
more semantic knowledge embedded in PathKeys now.)
src/backend/optimizer/path/pathkeys.c