PostgreSQL uses two different sorting algorithms, qsort and the external
sorting method in tuplesort.c. There are some possible improvements in
external sorting, so I'd like to check on the solidity of the testing
mechanisms.
Whether external sorting can be improved upon is a different debate,
though I do have reason to believe it is possible. Initially, I am
interested in proving correctness of any change, though the eventual
goal would be performance.
I'm looking through the regression tests, but can't find anything that
explicitly tests both types of sort.
If you run the regression tests against an existing database instance it
would be possible to run the tests with various values of work_mem so as
to force the sorts to either be internal or external.
...only problem is that the largest regression test table: tenk doesn't
occupy as much as 1 MB of space in total and work_mem cannot be set
lower than 1 MB.
Could anybody comment on whether the current tests appropriately cover
the correctness of the external sorting algorithms? Will any changes to
the external sort algorithms be appropriately tested by what is there
currently?
Best Regards, Simon Riggs