OSDN Git Service

Since sort_bounded_heap makes state changes that should be made
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 1 Sep 2007 18:47:39 +0000 (18:47 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 1 Sep 2007 18:47:39 +0000 (18:47 +0000)
commitd2825e1c855e2ce0e9d3e6bc2c6f3d7793394a04
tree9b8cc57c670685f61c088f73a20267d898caed08
parent0ee5a39862748b846786db48f41cc29eab38c015
Since sort_bounded_heap makes state changes that should be made
regardless of the number of tuples involved, it's incorrect to skip it
when memtupcount = 1; the number of cycles saved is minuscule anyway.
An alternative solution would be to pull the state changes out to the
call site in tuplesort_performsort, but keeping them near the corresponding
changes in make_bounded_heap seems marginally cleaner.  Noticed by
Greg Stark.
src/backend/utils/sort/tuplesort.c