Re: New feature request: FlashBack Query

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas ADI SD
Тема Re: New feature request: FlashBack Query
Дата
Msg-id E1539E0ED7043848906A8FF995BDA57901CAF1AF@m0143.s-mxs.net
обсуждение исходный текст
Ответ на Re: New feature request: FlashBack Query  (Hannu Krosing <hannu@skype.net>)
Ответы Re: New feature request: FlashBack Query  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
> > Well this is certainly interesting. What do we think it
> would take to
> > enable the functionality?
>
> First we must run the query in serializable mode and replace
> the snapshot with a synthetic one, which defines visibility
> at the start of the desired transaction

We could use something that controls "global xmin".
It would ensure, that global xmin does not advance bejond
what still needs to be visible. This would probably be a
sliding time window, or a fixed point in time that is
released by the dba/user.

Then all below is not really different from a situation where
you had a long running tx.

> probably it is a good idea to take a lock on all tables
> involved to avoid a vacuum to be started on them when the
> query is running.
>
> also, we can't trust the DELETED flags in index pages, so we
> should forbid index scans, or just always re-check the
> visibility in heap.
>
> Otherways it would probably be enough to just scan tuples as
> usual, and check if they were visible to desired transaction,
> that is they were inserted before that transaction and they
> are not deleted before that trx.
>
> Of course this will not be true, once we have HOT/WIP with
> in-page vacuuming.

Currently I think HOT does honor "global xmin". There is no
lookup for relevant xids, so parts of an update chain where
only a previous tuple or a later tuple can be visible are reused.
Else Hot would need to be told not to, in a scenario where
a backend can choose a snapshot at will.

Andreas


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: New feature request: FlashBack Query
Следующее
От: "Zeugswetter Andreas ADI SD"
Дата:
Сообщение: Re: New feature request: FlashBack Query