Re: B-Tree support function number 3 (strxfrm() optimization)

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>, Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: B-Tree support function number 3 (strxfrm() optimization)
Date: 2015-01-21 22:50:24
Message-ID: 87vbjzkbsz.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Peter" == Peter Geoghegan <pg(at)heroku(dot)com> writes:

Peter> Okay, then. I concede the point: We should support the datum
Peter> case as you outline, since it is simpler than any
Peter> alternative. It probably won't even be necessary to formalize
Peter> the idea that finished abbreviated keys must be pass-by-value
Peter> (at least not for the benefit of this functionality); if someone
Peter> writes an opclass that generates pass-by-reference abbreviated
Peter> keys (I think that might actually make sense, although I'm being
Peter> imaginative), it simply won't work for the datum sort case,
Peter> which is probably fine.

I don't see why a by-reference abbreviated key would be any more of an
issue for the datum sorter than for anything else. In either case you'd
just get excess memory usage (any memory allocated by the abbreviation
function for the result won't be charged against work_mem and won't be
freed until the sort ends).

What matters for the datum sorter (and not for the others) is that we
not try and abbreviate a by-value type (since we only have an allocated
copy of the value if it was by-reference); this is handled in the code
by just not asking for abbreviation in such cases.

Peter> Are you going to submit this to the final commitfest? I'll
Peter> review it if you do.

I'll post a cleaned-up version after the existing issues are fixed.

--
Andrew (irc:RhodiumToad)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2015-01-21 23:08:28 Re: Temporal features in PostgreSQL
Previous Message Peter Geoghegan 2015-01-21 22:33:40 Re: B-Tree support function number 3 (strxfrm() optimization)