Re: Progress on fast path sorting, btree index creation time
Peter Geoghegan <peter@2ndquadrant.com>
From: Peter Geoghegan <peter@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Noah Misch <noah@leadboat.com>, Jay Levitt <jay.levitt@gmail.com>, "Jim Decibel! Nasby" <decibel@decibel.org>, Bruce Momjian <bruce@momjian.us>, Tom Lane <tgl@sss.pgh.pa.us>, PG Hackers <pgsql-hackers@postgresql.org>
Date: 2012-02-10T15:30:15Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
During btree index build, sort equal-keyed tuples according to their
- fbac1272b89b 8.0.0 cited
Attachments
- fastpath_sort_2012_02_10.patch (text/x-patch) patch
On 9 February 2012 14:51, Robert Haas <robertmhaas@gmail.com> wrote: > I'm not sure I entirely follow all this, but I'll look at the code > once you have it. I have attached a revision of the patch, with the adjustments already described. Note that I have not made this support btree tuplesorting yet, as there is an impedance mismatch that must be resolved, particularly with the SortSupport stuff, and I wanted to know what you think of the multiple key specialisation first. Arguably, we could get away with only a single specialisation - I haven't really though about it much. You say "Well, how often will we sort 10,000 integers?", and I think that btree index creation is one very common and useful case, so I'd like to look at that in more detail. I certainly don't see any reason to not do it too. This should give you performance for sorting multiple-keys that is almost as good as the single-key optimisation that you found to be more compelling. Obviously the need to actually call comparetup_heap to look at non-leading sortkeys will vary from case to case, and this is based on your test case, where there are no duplicates and thus no need to ever do that. That isn't too far from representative, as I think that in general, a majority of comparisons won't result in equality. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services