Re: CREATE INDEX and HOT - revised design

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: CREATE INDEX and HOT - revised design
Дата
Msg-id 460AAB49.5010500@phlo.org
обсуждение исходный текст
Ответ на Re: CREATE INDEX and HOT - revised design  ("Simon Riggs" <simon@2ndquadrant.com>)
Ответы Re: CREATE INDEX and HOT - revised design  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Simon Riggs wrote:
> On Wed, 2007-03-28 at 22:24 +0530, Pavan Deolasee wrote:
> 
>> Just when I thought we have nailed down CREATE INDEX, I realized 
>> that there something more to worry. The problem is with the HOT-chains
>> created by our own transaction which is creating the index. We thought
>> it will be enough to index the tuple at the head-of-the-chain since
>> that 
>> would be the visible copy once the transaction commits. We thought
>> of keeping the index unavailable for queries in pre-existing
>> transactions
>> by setting a new "xid" attribute in pg_index. The question is what
>> value 
>> to assign to "xid". I though we would assign ReadNewTransactionId().>
> If you are indexing a table that hasn't just been created by you, set
> the xcreate field on pg_index at the *end* of the build using
> ReadNewTransactionId(). Any xid less than that sees the index as
> invalid. If you created the table in this transaction (i.e.
> createSubId != 0) then set xcreate to creating xid.

Couldn't you store the creating transaction's xid in pg_index, and
let other transaction check that against their snapshot like they
would for any tuple's xmin or xmax? (With one exception - the creating
transaction would consider indices it built itself invalid, which
is not how things usually work for xmin/xmax).

This would mean that any transaction that believes that the creating
transaction has committed also consideres the index to be valid.

greetings, Florian Pflug



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Modifying TOAST thresholds
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Modifying TOAST thresholds