pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Josh Berkus <josh@agliodbs.com>
Cc: Sven R. Kunze <srkunze@tbz-pariv.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Reverse Key Index
Date: Thu, 26 Feb 2015 14:37:04 +0200
Message-ID: <54EF1370.2000006@iki.fi> (raw)
In-Reply-To: <54EE4D45.1060704@agliodbs.com>
References: <54DF9036.8080502@tbz-pariv.de>
	<7978.1423937899@sss.pgh.pa.us>
	<54DF9559.8080109@tbz-pariv.de>
	<WM!ac1d64cef832673f1f6089d7c26e717d0c09326c990d42e4ac6c27c98e44612c4261de1a99f3eaf40ab4ae5310bbe616!@asav-1.01.com>
	<54EE4D45.1060704@agliodbs.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (11+ messages)  latest in thread

Message-ID: <54EF1370.2000006@iki.fi>
Permalink:  ../54EF1370.2000006@iki.fi/
Also on:    postgresql.org/message-id/54EF1370.2000006@iki.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: hlinnaka@iki.fi, josh@agliodbs.com, srkunze@tbz-pariv.de, tgl@sss.pgh.pa.us
  Subject: Re: Reverse Key Index
  In-Reply-To: <54EF1370.2000006@iki.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox