Hi,
Generally speaking, build the heap by tuplesort_heap_build() is O(n) while tuplesort_heap_insert() is
O(n log n), so the former is better.
I'm not sure why tuplesort_heap_build() is worse than tuplesort_heap_insert() when handling random
data sometimes, maybe my test method is wrong? Any ideas?
The v2-0001 refactor some code, mark some function as always inline and reduce some useless copy
of SortTuple.
--
Regards,
ChangAo Chen