Re: When Update balloons memory - Mailing list pgsql-bugs

From Peter Geoghegan
Subject Re: When Update balloons memory
Date
Msg-id CAH2-Wzk=5jGMdS4UWmQJ9m3YQGot9K5ZcBqCQ-_J55rjK7MHAA@mail.gmail.com
Whole thread Raw
In response to Re: When Update balloons memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: When Update balloons memory
List pgsql-bugs
On Tue, Dec 14, 2021 at 11:33 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I'd be inclined to do so if we can find a suitable place to put it.
> But wouldn't a field in IndexInfo serve?  Letting the field default
> to "not optimizable" would cover most cases.

Attached draft HEAD-only bugfix adds two new bool fields to IndexInfo.
The first bool indicates if we've already done the required work for
this IndexInfo. The second field is used as a cache (if the cache is
set the first bool is 'true'). These two fields fit in existing
alignment padding, so the marginal space overhead is zero.

I'll probably need to greatly simplify the code for backpatch, to
avoid an ABI break. Seems fine to teach index_unchanged_by_update to
return "true" unconditionally, given how the IndexUnchanged hint is
currently applied.

I haven't made the code use pull_varnos(), which you suggested back in
December. It looks like it would be tricky to do that from the
executor, since pull_varnos() has a PlannerInfo* argument. That has
been the case since your commit 55dc86eca7 from January 2021, "Fix
pull_varnos' miscomputation of relids set for a PlaceHolderVar".
Please advise.

-- 
Peter Geoghegan

Attachment

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17362: Error "could not find block containing chunk" when using index with icu collation on CentOS 7
Next
From: Tom Lane
Date:
Subject: Re: When Update balloons memory