On 01.03.2018 22:48, Andres Freund wrote:
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 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.
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company