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 1gKjLQ-0002Eq-KG for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Nov 2018 12:23:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gKjLP-00058S-3N for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Nov 2018 12:23:31 +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 1gKjLO-00058L-SO for pgsql-hackers@lists.postgresql.org; Thu, 08 Nov 2018 12:23:30 +0000 Received: from mx2a.mailbox.org ([2001:67c:2050:104:0:2:25:2] helo=mx2.mailbox.org) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gKjLJ-0004LP-FN for pgsql-hackers@postgresql.org; Thu, 08 Nov 2018 12:23:30 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 0530FA10FC; Thu, 8 Nov 2018 13:23:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id EnQankX_syzC; Thu, 8 Nov 2018 13:23:22 +0100 (CET) Message-ID: Subject: Re: [HACKERS] Surjective functional indexes From: Laurenz Albe To: Tom Lane , Simon Riggs Cc: Robert Haas , Andres Freund , Konstantin Knizhnik , Stephen Frost , Michael Paquier , Alvaro Herrera , Christoph Berg , Thomas Munro , Peter Eisentraut , PostgreSQL Hackers Date: Thu, 08 Nov 2018 13:23:19 +0100 In-Reply-To: <25975.1541618754@sss.pgh.pa.us> References: <20171214211553.ijxfd4p52nz7qg44@alvherre.pgsql> <623fdf0f-c3d1-7553-e784-f8d5a900239b@postgrespro.ru> <20180106225942.GT2416@tamriel.snowman.net> <40fd1ef1-6227-69d1-9a24-edfef875e006@postgrespro.ru> <20180301194824.46ivyszju2ivhlh5@alap3.anarazel.de> <20180511033227.vvgm3yi5xngro2hp@alap3.anarazel.de> <20180511143737.rvogcsxdksrhyyj5@alap3.anarazel.de> <25975.1541618754@sss.pgh.pa.us> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane wrote: > I wanted to enumerate my concerns while yesterday's > events are still fresh in mind. (Andres or Robert might have more.) > > * I do not understand why this feature is on-by-default in the first > place. It can only be a win for expression indexes that are many-to-one > mappings; for indexes that are one-to-one or few-to-one, it's a pretty > big loss. I see no reason to assume that most expression indexes fall > into the first category. I suggest that the design ought to be to use > this optimization only for indexes for which the user has explicitly > enabled recheck_on_update. That would allow getting rid of the cost check > in IsProjectionFunctionalIndex, about which we'd otherwise have to have > an additional fight: I do not like its ad-hoc-ness, nor the modularity > violation (and potential circularity) involved in having the relcache call > cost_qual_eval. That was my impression too when I had a closer look at this feature. What about an option "hot_update_check" with values "off" (default), "on" and "always"? Yours, Laurenz Albe