Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YMhYJ-0007Ys-Mi for pgsql-performance@arkaria.postgresql.org; Sat, 14 Feb 2015 18:34:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YMhYI-0007ox-GE for pgsql-performance@arkaria.postgresql.org; Sat, 14 Feb 2015 18:34:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YMhYH-0007oq-BL for pgsql-performance@postgresql.org; Sat, 14 Feb 2015 18:34:49 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YMhY8-0003Cr-BV for pgsql-performance@postgresql.org; Sat, 14 Feb 2015 18:34:48 +0000 Received: from comserver.tbz-pariv.de ([194.113.71.71]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0MRDId-1Y9syw0EPf-00UaPb; Sat, 14 Feb 2015 19:34:37 +0100 Received: from localhost (localhost [127.0.0.1]) by comserver.tbz-pariv.de (Postfix) with ESMTP id 297AB20746; Sat, 14 Feb 2015 19:34:36 +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 vmkxk1QG2MTb; Sat, 14 Feb 2015 19:34:34 +0100 (CET) Received: from [192.168.156.12] (unknown [192.168.156.12]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by comserver.tbz-pariv.de (Postfix) with ESMTPSA id 35BA720738; Sat, 14 Feb 2015 19:34:34 +0100 (CET) Message-ID: <54DF9559.8080109@tbz-pariv.de> Date: Sat, 14 Feb 2015 19:35:05 +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: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Reverse Key Index References: <54DF9036.8080502@tbz-pariv.de> <7978.1423937899@sss.pgh.pa.us> In-Reply-To: <7978.1423937899@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:XQ4vsik7r9MzhgjoGKBZn72Xf2Gj3e4PTFbU4xtz1LROr9Ub3eM SfmI+G4Km+kbm0kc5OyuT6OBequ9q7FqL41TYGjCBBNHoVixYSWNssrJ1mg5MEf7huPgHd3 nnurIYc+/TdPlMyxCRO7ZYAJtLlykcjYiFls66LaIQmdojqHo1svAa7giqgoCPxJmbwg0SM r7/PXN/g/TLgJ055EnFAQ== 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 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=20 use PostgreSQL. There, programmers would have to change a lot of code to=20 tweak existing (and more importantly working) queries to hash/reverse an=20 id column first. Using ORMs would make this change even more painful and=20 maybe even impossible. When reading=20 https://richardfoote.wordpress.com/2008/01/14/introduction-to-reverse-key-i= ndexes-part-i/=20 carefully, it also seems to work with index scan partially in case of=20 equality comparisons. On 14.02.2015 19:18, Tom Lane wrote: > "Sven R. Kunze" writes: >> does PostgreSQL support the concept of reverse key indexing as described >> here? I couldn't find any documentation on this yet. >> http://www.toadworld.com/platforms/oracle/w/wiki/11075.reverse-key-index= -from-the-concept-to-internals.aspx > There's nothing built-in for that (and frankly, it doesn't sound useful > enough that we'd ever add it). You could get the effect easily enough > with an expression index on a byte-reversing function. A related thing > that people often do is create an index on a hash function. > > regards, tom lane --=20 Sven R. Kunze TBZ-PARIV GmbH, Bernsdorfer Str. 210-212, 09130 Chemnitz Tel: +49 (0)371 33714721, Fax: +49 (0)371 5347920 e-mail: srkunze@tbz-pariv.de web: www.tbz-pariv.de Gesch=E4ftsf=FChrer: 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