Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YQkUf-0005T0-AA for pgsql-performance@arkaria.postgresql.org; Wed, 25 Feb 2015 22:31:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YQkUe-0006tA-HB for pgsql-performance@arkaria.postgresql.org; Wed, 25 Feb 2015 22:31:48 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YQkUd-0006t3-5E for pgsql-performance@postgresql.org; Wed, 25 Feb 2015 22:31:47 +0000 Received: from mx-out.zmailcloud.com ([192.198.85.98] helo=mx-out-1.zmailcloud.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YQkUV-0002UA-ME for pgsql-performance@postgresql.org; Wed, 25 Feb 2015 22:31:45 +0000 Received: from smtp.01.com (smtp.01.com [10.10.0.43]) by mx-out-1.zmailcloud.com (Postfix) with ESMTP id 6ACCF563EF2; Wed, 25 Feb 2015 16:31:38 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 620456022C; Wed, 25 Feb 2015 16:31:38 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FrWyJJ6hsGYE; Wed, 25 Feb 2015 16:31:38 -0600 (CST) Received: from smtp.01.com (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 4143E60231; Wed, 25 Feb 2015 16:31:38 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by smtp-out-2.01.com (Postfix) with ESMTP id 2AEA260230; Wed, 25 Feb 2015 16:31:38 -0600 (CST) X-Virus-Scanned: amavisd-new at smtp-out-2.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-2.01.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WoNPUxybLwgk; Wed, 25 Feb 2015 16:31:38 -0600 (CST) Received: from [172.47.23.102] (50-0-89-53.dsl.dynamic.fusionbroadband.com [50.0.89.53]) by smtp-out-2.01.com (Postfix) with ESMTPSA id 7D3DA6022C; Wed, 25 Feb 2015 16:31:37 -0600 (CST) Message-ID: <54EE4D45.1060704@agliodbs.com> Date: Wed, 25 Feb 2015 14:31:33 -0800 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "Sven R. Kunze" , Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Reverse Key Index References: <54DF9036.8080502@tbz-pariv.de> <7978.1423937899@sss.pgh.pa.us> <54DF9559.8080109@tbz-pariv.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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! -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance