From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: Andres Freund <andres@anarazel.de>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Simon Riggs <simon@2ndquadrant.com>
Cc: Christoph Berg <myon@debian.org>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Surjective functional indexes
Date: Fri, 2 Mar 2018 15:34:12 +0300
Message-ID: <ca0a8ddb-33a3-d7e8-58d7-aeddcb246830@postgrespro.ru> (raw)
In-Reply-To: <20180301194824.46ivyszju2ivhlh5@alap3.anarazel.de>
References: <aad81201-8788-a621-2001-537d843186fb@postgrespro.ru>
<20171214211553.ijxfd4p52nz7qg44@alvherre.pgsql>
<CAB7nPqR8GPni-Y_Tr1+6XFdYCuum8a5MuB9q2+hnVcA7BYrorw@mail.gmail.com>
<623fdf0f-c3d1-7553-e784-f8d5a900239b@postgrespro.ru>
<20180106225942.GT2416@tamriel.snowman.net>
<40fd1ef1-6227-69d1-9a24-edfef875e006@postgrespro.ru>
<20180301194824.46ivyszju2ivhlh5@alap3.anarazel.de>
On 01.03.2018 22:48, Andres Freund wrote:
> Hi,
>
> I still don't think, as commented upon by Tom and me upthread, that we
> want this feature in the current form.
>
> Your arguments about layering violations seem to be counteracted by the
> fact that ProjectionIsNotChanged() basically appears to do purely
> executor work inside inside heapam.c.
ProjectionIsNotChanged doesn't perform evaluation itslef, is calls FormIndexDatum.
FormIndexDatum is also called in 13 other places in Postgres:
analyze.c, constraint.c, index.c, tuplesort, execIndexing.c
I still think that trying to store somewhere result odf index expression evaluation to be able to reuse in index update is not so good idea:
it complicates code and add extra dependencies between different modules.
And benefits of such optimization are not obvious: is index expression evaluation is so expensive, then recheck_on_update should be prohibited for such index at all.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: k.knizhnik@postgrespro.ru, andres@anarazel.de, sfrost@snowman.net, michael.paquier@gmail.com, alvherre@alvh.no-ip.org, simon@2ndquadrant.com, myon@debian.org, thomas.munro@enterprisedb.com, peter.eisentraut@2ndquadrant.com
Subject: Re: [HACKERS] Surjective functional indexes
In-Reply-To: <ca0a8ddb-33a3-d7e8-58d7-aeddcb246830@postgrespro.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox