Re: snapshot question

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: snapshot question
Дата
Msg-id Y4/7I4zz+Y6AYZhQ@momjian.us
обсуждение исходный текст
Ответ на snapshot question  (qihua wu <staywithpin@gmail.com>)
Список pgsql-general
On Wed, Dec  7, 2022 at 10:20:09AM +0800, qihua wu wrote:
> Per the following link: https://www.sobyte.net/post/2022-08/postgres-snapshot/
> To get a snapshot we need to know xmin, xmax and xip. my question is why do we
> need them? Since every tuple in a page has t_xmin and t_xmax based on the page
> layout(https://www.postgresql.org/docs/current/storage-page-layout.html), if we
> has a snapshot at xip 12345, couldn't we just check every tuple whose t_xmin is
> lower than 12345 and already committed?

See, slides 9-11:

    https://momjian.us/main/presentations/internals.html#mvcc

xip is a list of transaction that were open at the time the snapshot was
taken.  If the transaction commits after the snapshot is taken, it is
still invisible.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

Embrace your flaws.  They make you human, rather than perfect,
which you will never be.



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

Предыдущее
От: qihua wu
Дата:
Сообщение: snapshot question
Следующее
От: "Ryo Yamaji (Fujitsu)"
Дата:
Сообщение: RE: About row locking ordering