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)
commita0bacc9d5ba6e1dbc1b72091a6407604f1c21341
tree373f80bfa1ce95152b03fc889465ae3858cfed3e
parentc63d166393f5576d1104751d6b1e7d9919e73357
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