Re: An out-of-date comment in nodeIndexonlyscan.c

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Ashwin Agrawal <aagrawal@pivotal.io>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>, Heikki Linnakangas <hlinnaka@iki.fi>, Kevin Grittner <kgrittn@gmail.com>
Date: 2021-06-13T12:01:48Z
Lists: pgsql-hackers

Attachments

On Sat, Jun 12, 2021 at 2:35 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> ... and here is the corresponding code change, with a test to
> demonstrate the change.
>
> I'm working on a proof-of-concept to skip the btree page lock
> sometimes too, which seems promising, but it requires some planner
> work which has temporarily pretzeled my brain.

Here's a highly experimental patch I came up with that seems to
produce the right results in simple cases, without (yet) involving the
planner.  The regression tests show single table queries, but it works
also for nest loop joins, which is where this optimisation should be
most interesting, I think.  There are a few weird things about this
patch though, and there could well be much better ways to do it, as
noted in the commit message and comments.  It's a start on the
problem...

Commits

  1. Block ALTER INDEX/TABLE index_name ALTER COLUMN colname SET (options)

  2. Fix misleading comment in nodeIndexonlyscan.c.

  3. Eliminate xmin from hash tag for predicate locks on heap tuples.

  4. Fix serializable mode with index-only scans.