Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKtIp-0004XM-IF for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Nov 2018 23:01:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gKtIl-0003hK-RG for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Nov 2018 23:01:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKtIl-0003hD-Jz for pgsql-hackers@lists.postgresql.org; Thu, 08 Nov 2018 23:01:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKtIj-0003BS-1m for pgsql-hackers@postgresql.org; Thu, 08 Nov 2018 23:01:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wA8N0t19011219; Thu, 8 Nov 2018 18:00:55 -0500 From: Tom Lane To: Alvaro Herrera cc: Konstantin Knizhnik , Laurenz Albe , Simon Riggs , Robert Haas , Andres Freund , Stephen Frost , Michael Paquier , Christoph Berg , Thomas Munro , Peter Eisentraut , PostgreSQL Hackers Subject: Re: [HACKERS] Surjective functional indexes In-reply-to: <20181108190559.ylzufqr2jjvml32f@alvherre.pgsql> References: <20181108190559.ylzufqr2jjvml32f@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 08 Nov 2018 16:05:59 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11217.1541718055.1@sss.pgh.pa.us> Date: Thu, 08 Nov 2018 18:00:55 -0500 Message-ID: <11218.1541718055@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2018-Nov-08, Konstantin Knizhnik wrote: >> Before doing any other refactoring of projection indexes I want to attach >> small bug fix patch which >> fixes the original problem (SIGSEGV) and also disables recheck_on_update by >> default. >> As Laurenz has suggested, I replaced boolean recheck_on_update option with >> "on","auto,"off" (default). > I think this causes an ABI break for GenericIndexOpts. Not sure to what > extent that is an actual problem (i.e. how many modules were compiled > with 11.0 that are gonna be reading that struct with later Pg), but I > think it should be avoided anyhow. I do not see the point of having more than a boolean option anyway, if the default is going to be "off". If the user is going to the trouble of marking a specific index for this feature, what else is she likely to want other than having it "on"? The bigger picture here, and the reason for my skepticism about having any intelligence in the enabling logic, is that there is no scenario in which this code can be smarter than the user about what to do. We have no insight today, and are unlikely to have any in future, about whether a specific index expression is many-to-one or not. I have exactly no faith in cost-estimate-based logic either, because of the extremely poor quality of our function cost estimates --- very little effort has been put into assigning trustworthy procost numbers to the built-in functions, and as for user-defined ones, it's probably much worse. So that's why I'm on the warpath against the cost-based logic that's there now; I think it's just garbage-in-garbage-out. regards, tom lane