Bruce Momjian <bruce@momjian.us> writes:
> I did some performance testing of the patch, and the results were good.
> I did this:
> test=> CREATE TABLE test (x INTEGER);
> test=> INSERT INTO test SELECT * FROM generate_series(1, 1000000);
> test=> SET log_min_duration_statement = 0;
> test=> SELECT * FROM test ORDER BY x LIMIT 3;
LIMIT 3 seems an awfully favorable case; if the patch can only manage a
factor of 4 speedup there, what happens at limit 10, 20, 100? Also,
you've tested only one sort size and only one (unspecified) value of
work_mem, and the usefulness of the patch would surely vary depending on
that. In particular, what happens with a LIMIT large enough to overflow
work_mem?
Lastly, I suspect that sorting presorted input might be particularly
favorable for this patch. Please try it with random data for comparison.
regards, tom lane