Re: CREATE INDEX and HOT - revised design

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: CREATE INDEX and HOT - revised design
Дата
Msg-id 460D45A7.2050402@phlo.org
обсуждение исходный текст
Ответ на Re: CREATE INDEX and HOT - revised design  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: CREATE INDEX and HOT - revised design  ("Pavan Deolasee" <pavan.deolasee@gmail.com>)
Список pgsql-hackers
Tom Lane wrote:
> "Florian G. Pflug" <fgp@phlo.org> writes:
>> Tom Lane wrote:
>>> I do not think you can assume that the plan won't be used later with
>>> some older snapshot.
> 
>> So maybe we'd need to use the SerializableSnapshot created at the start
>> of each transaction for this check, and not the ActiveSnapshot? Could
>> that work?
> 
> That might work, but it doesn't seem to address the core objection:
> there's no mechanism to cause the query to be replanned once the
> snapshot is new enough, because no relcache inval will happen.  So
> most likely existing backends will keep using old plans that don't
> consider the index.

Pavan suggested storing the IndexSnapshot in the cached plan, and to 
compare it to the IndexSnapshot when the query is executed.
If those two snapshots differ, the query would be replanned.

My idea was to store a list of xid's together with the cached plan that
are assumed to be uncommitted accoring to the IndexSnapshot. The query
is replanned if upon execution the IndexSnapshot assumes that one of
these xid's is committed.

Those two ideas seem to be mostly equivalent, mine seems to be a bit
more fine-grained, but at the cost of more work upon each query execution.

greetings, Florian Pflug


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

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