Re: [HACKERS] Surjective functional indexes - Mailing list pgsql-hackers

From Konstantin Knizhnik
Subject Re: [HACKERS] Surjective functional indexes
Date
Msg-id ca0a8ddb-33a3-d7e8-58d7-aeddcb246830@postgrespro.ru
Whole thread Raw
In response to Re: [HACKERS] Surjective functional indexes  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] Surjective functional indexes  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers

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
isnot 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_updateshould be prohibited for such index at all.
 

-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



pgsql-hackers by date:

Previous
From: ilmari@ilmari.org (Dagfinn Ilmari Mannsåker)
Date:
Subject: Re: perltidy version
Next
From: Magnus Hagander
Date:
Subject: Re: perltidy version