Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTRuP-0001K1-8v for pgsql-performance@arkaria.postgresql.org; Thu, 05 Mar 2015 09:17:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTRuO-0002Xv-8v for pgsql-performance@arkaria.postgresql.org; Thu, 05 Mar 2015 09:17:32 +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 1YTRuN-0002Xm-0r for pgsql-performance@postgresql.org; Thu, 05 Mar 2015 09:17:31 +0000 Received: from mout.kundenserver.de ([212.227.126.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTRuF-0008KO-EZ for pgsql-performance@postgresql.org; Thu, 05 Mar 2015 09:17:29 +0000 Received: from comserver.tbz-pariv.de ([194.113.71.71]) by mrelayeu.kundenserver.de (mreue005) with ESMTPSA (Nemesis) id 0Mg2TZ-1Y8s6t0KX7-00NUwf; Thu, 05 Mar 2015 10:17:10 +0100 Received: from localhost (localhost [127.0.0.1]) by comserver.tbz-pariv.de (Postfix) with ESMTP id CD44621A2C; Thu, 5 Mar 2015 10:17:08 +0100 (CET) X-Virus-Scanned: amavisd-new at tbz-pariv.de Received: from comserver.tbz-pariv.de ([127.0.0.1]) by localhost (comserver.tbz-pariv.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QxND5HOYDDsE; Thu, 5 Mar 2015 10:17:07 +0100 (CET) Received: from [172.17.6.169] (apsrkunze.tbz-pariv.lan [172.17.6.169]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by comserver.tbz-pariv.de (Postfix) with ESMTPSA id 34D9321A00; Thu, 5 Mar 2015 10:17:07 +0100 (CET) Message-ID: <54F81F3F.3010607@tbz-pariv.de> Date: Thu, 05 Mar 2015 10:17:51 +0100 From: "Sven R. Kunze" Organization: TBZ-PARIV GmbH User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: hlinnaka@iki.fi, Josh Berkus CC: Tom Lane , 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> <54EE4D45.1060704@agliodbs.com> <54EF1370.2000006@iki.fi> In-Reply-To: <54EF1370.2000006@iki.fi> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:qy4aUH44A47s/6bwPQdgIOqyPCFbraLQgQkvPp3/LTAsasFcBwr 0H0moHuzEcaQG9Ecna9/4FVuY/G+xbSPTzWqDBQ0hXIsbTNHOAycOdo/AEgFU4aRG8f0ei5 B3Fn+VsUyOzvccDYnUYV3UKLvw1UtYzvGE+2vCgU2qZ6lMqTb2vZ+H4N2vRsFqtkwfaXru6 yZ+frYbIvBFv+NYoJ7O1Q== X-UI-Out-Filterresults: notjunk:1; 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 26.02.2015 13:37, Heikki Linnakangas wrote: > 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=20 >>> code to >>> tweak existing (and more importantly working) queries to=20 >>> hash/reverse an >>> id column first. Using ORMs would make this change even more painful=20 >>> and >>> maybe even impossible. >>> >>> When reading >>> https://richardfoote.wordpress.com/2008/01/14/introduction-to-reverse-k= ey-indexes-part-i/=20 >>> >>> 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 > Thanks for the hint. That also sounds easy to implement. Regards, --=20 Sven R. Kunze TBZ-PARIV GmbH, Bernsdorfer Str. 210-212, 09126 Chemnitz Tel: +49 (0)371 33714721, Fax: +49 (0)371 5347920 e-mail: srkunze@tbz-pariv.de web: www.tbz-pariv.de Gesch=C3=A4ftsf=C3=BChrer: Dr. Reiner Wohlgemuth Sitz der Gesellschaft: Chemnitz Registergericht: Chemnitz HRB 8543 --=20 Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance