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

[PATCH] HOT on tables with oid indexes broken

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Subject: [PATCH] HOT on tables with oid indexes broken
Date: 2013-01-31 12:37:35
Message-ID: 20130131123735.GA13337@awork2.anarazel.de (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

The fklocks patch moved HeapSatisfiesHOTandKeyUpdate (or rather
HeapSatisfiesHOTUpdate back then) to be called way earlier in
heap_update as its needed to know which lock level is
required. Unfortunately the oid of the new tuple isn't yet setup at that
point.

Due to this everytime there's an index on an oid - like in most catalog
tables - no HOT updates will be performed as the old tuples oid will be
compared to the new ones which isn't setup yet (so either InvalidOid or
uninitialized).

There's also a related bug which seems to go further back but has far
fewer implications, namely that the tableOid of the old tuple isn't
necessarily setup before determining HOTability. Now that only matters
if there's an index on 'tableoid' which doesn't seem to be an all that
frequent thing to do.

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment: 0001-Copy-a-tuple-s-oid-early-enough-in-heap_update-for-H.patch
Description: text/x-patch (2.8 KB)

Responses

pgsql-hackers by date

Next:From: MauMauDate: 2013-01-31 12:40:39
Subject: Re: backend hangs at immediate shutdown
Previous:From: MauMauDate: 2013-01-31 12:12:06
Subject: Re: backend hangs at immediate shutdown

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