diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-21 19:49:15 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-21 19:49:15 +0000 |
commit | a3f0b3d68f9a5357a3f72b40a45bcc714a9e0649 (patch) | |
tree | f9a5603f10b89badd1f7de5af3bfc16865224ea2 /src/backend/access/gist/gistxlog.c | |
parent | 570b726533fb561bc5a35ba50ea944f139a250d5 (diff) | |
download | postgresql-a3f0b3d68f9a5357a3f72b40a45bcc714a9e0649.tar.gz postgresql-a3f0b3d68f9a5357a3f72b40a45bcc714a9e0649.zip |
Improve performance of our private version of qsort. Per recent testing,
the logic it contained to switch to insertion sort for near-sorted input was
in fact a big loss, because it could fairly easily be fooled into applying
insertion sort to large subfiles that weren't all that well ordered. Remove
that, and instead add a simple check for already-perfectly-sorted input, as
per suggestion from Dann Corbit. This adds at worst O(N*lgN) overhead, and
usually far less, while sometimes allowing a subfile sort to finish in O(N)
time. Preliminary testing says this is an improvement over the basic
Bentley & McIlroy code for many nonrandom inputs, and it costs almost
nothing when the input is random.
Diffstat (limited to 'src/backend/access/gist/gistxlog.c')
0 files changed, 0 insertions, 0 deletions