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

From: Peter Geoghegan <pg(at)heroku(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: 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>, Thom Brown <thom(at)linux(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: B-Tree support function number 3 (strxfrm() optimization)
Date: 2014-09-30 05:34:28
Message-ID: CAM3SWZT+V3LLRBSCyUJ9jOvuMDpBq6bUpF9woFBfuyWgwuHW3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 25, 2014 at 1:36 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> (concerns about a second sortsupport state)

I think I may have underestimated the cost of not have
sorttuple.datum1 with a pointer-to-text representation available in
cases such as the one you describe.

Attached revision introduces an alternative approach, which does not
have a separate sortsupport state struct. In the event of aborting
abbreviation, we go back and fix-up datum1 to have a consistently have
a pointer to text representation, making a comparator swap safe - at
that point, it's as if abbreviation was never even considered (apart
from the cost, of course). We still need a special tie-breaker
comparator, though.

I hope this addresses your concern.

--
Peter Geoghegan

Attachment Content-Type Size
0001-Abbreviated-sortsupport-keys.patch text/x-patch 53.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2014-09-30 05:34:29 Re: Fwd: Proper query implementation for Postgresql driver
Previous Message Tom Lane 2014-09-30 05:31:08 Re: Fwd: Proper query implementation for Postgresql driver