Skip site navigation (1) Skip section navigation (2)

rewrite HeapSatisfiesHOTAndKey

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>,Pavan Deolasee <pavan(dot)deolasee(at)2ndQuadrant(dot)com>
Subject: rewrite HeapSatisfiesHOTAndKey
Date: 2016-12-28 23:20:18
Message-ID: 20161228232018.4hc66ndrzpz4g4wn@alvherre.pgsql (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-hackers
Pursuant to my comments at
https://www.postgresql.org/message-id/20161223192245.hx4rbrxbrwtgwj6i@alvherre.pgsql
and because of a stupid bug I found in my indirect indexes patch, I
rewrote (read: removed) HeapSatisfiesHOTAndKey.  The replacement
function HeapDetermineModifiedColumns returns a bitmapset with a bit set
for each modified column, for those columns that are listed as
"interesting" -- currently that set is the ID columns, the "key"
columns, and the indexed columns.  The new code is much simpler, at the
expense of a few bytes of additional memory used during heap_update().

All tests pass.

Both WARM and indirect indexes should be able to use this infrastructure
in a way that better serves them than the current HeapSatisfiesHOTAndKey
(both patches modify that function in a rather ugly way).  I intend to
get this pushed shortly unless objections are raised.

The new coding prevents stopping the check early as soon as the three
result booleans could be determined.  However, both patches were adding
reasons to avoid stopping early anyway, so I don't think this is a
significant loss.

Pavan, please rebase your WARM patch on top of this and let me know how
you like it.  I'll post a new version of indirect indexes later this
week.

Comments welcome.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment: interesting-attrs.patch
Description: text/plain (8.3 KB)

Responses

pgsql-hackers by date

Next:From: Michael PaquierDate: 2016-12-28 23:35:37
Subject: Re: Support for pg_receivexlog --format=plain|tar
Previous:From: Tom LaneDate: 2016-12-28 23:17:26
Subject: Re: Improving RLS planning

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group