Re: a few questions (and doubts) about xid

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: a few questions (and doubts) about xid
Дата
Msg-id 87bqe0ziaw.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: a few questions (and doubts) about xid  (Luca Ferrari <fluca1978@infinito.it>)
Ответы Re: a few questions (and doubts) about xid  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
"Luca Ferrari" <fluca1978@infinito.it> writes:

>> If you really want to understand how snapshots work at this level you could
>> read (slowly -- it's pretty dense stuff) through
>> src/backend/utils/time/tqual.c:HeapTupleSatisfiesMVCC()
>
> I don't find it, I think you mean HeapTupleSatisfiesNow and
> HeapTupleSatisfiesSnapshot.

Sorry, HeapTupleSatisfiesSnapshot was renamed to HeapTupleSatisfiesMVCC,
they're two different versions of the same function.

> Just for confirmation: the relfrozenxid of a fresh table is the xid of the
> transaction that created it, isn't it?

Yes, easily enough checked:

postgres=# create table xyz (i integer);
CREATE TABLE
postgres=# select xmin,relfrozenxid from pg_class where relname = 'xyz';
  xmin   | relfrozenxid
---------+--------------
 4971524 |      4971524
(1 row)


But once you run vacuum that value will be changed. It represents the oldest
transaction id which can occur in the table. Every time vacuum runs if that
transaction is too old it will try to move it forward.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: Re: a few questions (and doubts) about xid
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Backslah in encrypt function.