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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Pre-set Hint bits/VACUUM FREEZE on data load..?
Date: 2011-03-24 21:08:02
Message-ID: 20110324210802.GG4116@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

In a discussion which came up at PgEast, I questioned if it'd be
possible to set the 'all visible' hint bit and give the tuples the
frozen XID when loading data into a table which was created in the
same transaction.

The idea being that no other transactions could see the table (in any
important way anyway.. couldn't SELECT from it, for example) since it
was created in the same transaction that the data was loaded. This
would avoid having to rewrite the table to set the hint bits and to
set the tuples as frozen after the data load.

There's a question here is about if concurrent transactions in
serializable or read isolated would be able to see the new table too
early, because catalog lookups typically use SnapshotNow, and hence
might see the new tuples when it really shouldn't be able to. It
seems odd to me that it might be able to select from this new table
which was committed in a transaction which started after the current
one though.

Anyway, just a thought that I wanted to get out to hackers before I
destroy the brain cells that it's stored in tonight... :)

Thanks,

Stephen

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-03-24 21:11:54 Re: Re: making write location work (was: Efficient transaction-controlled synchronous replication)
Previous Message Robert Haas 2011-03-24 20:59:10 Re: 2nd Level Buffer Cache