Re: CREATE INDEX and HOT - revised design

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: CREATE INDEX and HOT - revised design
Дата
Msg-id 2e78013d0703281112l5498c03ejfc6b0cb1b731214c@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CREATE INDEX and HOT - revised design  ("Simon Riggs" <simon@2ndquadrant.com>)
Ответы Re: CREATE INDEX and HOT - revised design  ("Simon Riggs" <simon@2ndquadrant.com>)
Список pgsql-hackers


On 3/28/07, Simon Riggs <simon@2ndquadrant.com> wrote:


Set it at the end, not the beginning.


At the end of what ? It does not help to set it at the end of CREATE
INDEX because the transaction may not commit immediately. In
the meantime, many new transactions may start with
transaction id > xcreate. All these transactions can see the old
tuple (which we did not index) and can also see the index once
CREATE INDEX commits.
 
 

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.



Why do we need to handle the case where  table is created in
the same transaction ? Neither the table nor the index is visible
until we commit. So thats a simple case.


Thanks,
Pavan


--

EnterpriseDB     http://www.enterprisedb.com

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: CREATE INDEX and HOT - revised design
Следующее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: CREATE INDEX and HOT - revised design