Re: Reverse Key Index - Mailing list pgsql-performance

From Heikki Linnakangas
Subject Re: Reverse Key Index
Date
Msg-id 54EF1370.2000006@iki.fi
Whole thread Raw
In response to Re: Reverse Key Index  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Reverse Key Index  ("Sven R. Kunze" <srkunze@tbz-pariv.de>)
List pgsql-performance
On 02/26/2015 12:31 AM, Josh Berkus wrote:
> On 02/14/2015 10:35 AM, Sven R. Kunze wrote:
>> Thanks for the immediate reply.
>>
>> I understand the use case is quite limited.
>>
>> On the other hand, I see potential when it comes to applications which
>> use PostgreSQL. There, programmers would have to change a lot of code to
>> tweak existing (and more importantly working) queries to hash/reverse an
>> id column first. Using ORMs would make this change even more painful and
>> maybe even impossible.
>>
>> When reading
>> https://richardfoote.wordpress.com/2008/01/14/introduction-to-reverse-key-indexes-part-i/
>> carefully, it also seems to work with index scan partially in case of
>> equality comparisons.
>
> Seems like a good use for SP-GiST.  Go for it!

A b-tree opclass that just compares from right-to-left would work just
as well, and perform better.

- Heikki



pgsql-performance by date:

Previous
From: "Sven R. Kunze"
Date:
Subject: Re: Reverse Key Index
Next
From: Thomas Kellerer
Date:
Subject: Re: Reverse Key Index