Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YQxTB-00029N-Ql for pgsql-performance@arkaria.postgresql.org; Thu, 26 Feb 2015 12:23:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YQxTB-0003hK-37 for pgsql-performance@arkaria.postgresql.org; Thu, 26 Feb 2015 12:23:09 +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 1YQxTA-0003hE-9m for pgsql-performance@postgresql.org; Thu, 26 Feb 2015 12:23:08 +0000 Received: from mout.kundenserver.de ([212.227.17.10]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YQxT5-0001Nl-LT for pgsql-performance@postgresql.org; Thu, 26 Feb 2015 12:23:07 +0000 Received: from comserver.tbz-pariv.de ([194.113.71.71]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0MBr6d-1YGH9K02bf-00Ak3F for ; Thu, 26 Feb 2015 13:22:57 +0100 Received: from localhost (localhost [127.0.0.1]) by comserver.tbz-pariv.de (Postfix) with ESMTP id 756262088D for ; Thu, 26 Feb 2015 13:22:55 +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 5axC-yvsGn19 for ; Thu, 26 Feb 2015 13:22:53 +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 C9C1120769 for ; Thu, 26 Feb 2015 13:22:53 +0100 (CET) Message-ID: <54EF1045.5040609@tbz-pariv.de> Date: Thu, 26 Feb 2015 13:23:33 +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: 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> <54EEFDA1.7020609@tbz-pariv.de> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:nsQl3U/Q7Kf4+0tPr4Q8FaHyhvsS67qfG+Fzsx/CjOJLAPe1l4R CxMxqd9VpUZljDcAFl035owS0Au3KiAf/yURg4AMBJC5EgBlXucpC6ISK7KLb3Q8pp6BpK5 /XVnh6b7lc7heZglvl5RRyWuTmmallIhbeRIbwQ6xYJ5JYnCt9Te1+BPilDw1O5ova19KDk 5KdHrimYZYFDSYwRFB3pw== 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 12:45, Thomas Kellerer wrote: > Sven R. Kunze schrieb am 26.02.2015 um 12:04: >> I just thought about btree indexes here mainly because they well-known a= nd well-used in ORM frameworks. > If your ORM framework needs to know about the internals of an index defin= ition or even requires a certain index type, then you should ditch that ORM= framework. As I said "Considering the documentation and third-party posts on GiST=20 and btree_gist, at least to me, it seems as if people would not want to=20 use that for integers; which in turn is the main use-case scenario for=20 reverse key indexes." > Apart from indexes supporting business constraints (e.g. a unique index) = neither the application nor the the ORM framework should care about indexes= at all. Well, the world is not perfect:=20 http://www.joelonsoftware.com/articles/LeakyAbstractions.html >> does PostgreSQL support the concept of reverse key indexing as described= here? > The real question is: why do you think you need such an index? > Do you have any performance problems with the existing BTree index? If ye= s, which problem exactly? > This is not the real question. I never said I personally have to solve=20 issue around that. If so, I would have provide more detailed information=20 on the issue. However, I clearly see benefits of Oracle's solution over "You could get=20 the effect easily enough with an expression index on a byte-reversing=20 function. A related thing that people often do is create an index on a=20 hash function." These benefits, I described here: "On the other hand, I see potential=20 when it comes to applications which use PostgreSQL. There, programmers=20 would have to change a lot of code to tweak existing (and more=20 importantly working) queries to hash/reverse an id column first. Using=20 ORMs would make this change even more painful and maybe even impossible." So, this discussion is more about what can PostgreSQL offer in=20 comparison to already existing solutions. I perfectly see Tom's proposal=20 as a as-is solution but it has the drawbacks described above. If you think Reverse Key Indexes have no usage here in PostgreSQL, you=20 should not support convenience features for easily improving performance=20 without breaking the querying API or you won't have any intentions to=20 include such a patch, just let me know and we can close the issue=20 immediately. --=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