Re: Pre-set Hint bits/VACUUM FREEZE on data load..?

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Pre-set Hint bits/VACUUM FREEZE on data load..?
Date: 2011-03-25 08:09:42
Message-ID: 4D8C4DC6.1070900@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25.03.2011 00:15, Stephen Frost wrote:
> At the start of a load, we check if the table was created in the current
> transaction. If so, we check if we've already done a load which used
> the frozen XID. If we have, then we use the normal mechanics. If we
> havn't, then we stuff what the XID would have been in memory somewhere,
> mark that we've used the frozen XID, and load the data using the frozen
> XID. On subsequent queries, if we come across a frozen XID in a table
> created in this transaction, we use the XID we've stored instead of the
> frozen XID.

The tricky part here is how to check if the table was created in the
same transaction, within HeapTupleSatisfiesMVCC, with minimal overhead.
If you do it naively, the check will be executed at every single tuple
read in the system. It has to be really really fast.

I don't want to discourage, maybe it's possible with some clever code
arrangement. However, it needs a lot of performance testing.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gianni Ciolli 2011-03-25 08:46:17 Re: maximum digits for NUMERIC
Previous Message Daniel Farina 2011-03-25 08:05:42 Re: Pre-set Hint bits/VACUUM FREEZE on data load..?