Re: B-Tree support function number 3 (strxfrm() optimization) - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: B-Tree support function number 3 (strxfrm() optimization)
Date
Msg-id CAM3SWZT+V3LLRBSCyUJ9jOvuMDpBq6bUpF9woFBfuyWgwuHW3A@mail.gmail.com
Whole thread Raw
In response to Re: B-Tree support function number 3 (strxfrm() optimization)  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: B-Tree support function number 3 (strxfrm() optimization)  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Thu, Sep 25, 2014 at 1:36 PM, Robert Haas <robertmhaas@gmail.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

pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: Re: Fwd: Proper query implementation for Postgresql driver
Next
From: Tom Lane
Date:
Subject: Re: Proper query implementation for Postgresql driver