pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedQuestion about HeapTupleHeaderData
2+ messages / 2 participants
[nested] [flat]
* Question about HeapTupleHeaderData
@ 2007-05-24 08:56 Federico <rotellaro@gmail.com>
2007-05-25 14:30 ` Re: Question about HeapTupleHeaderData Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 1 reply; 2+ messages in thread
From: Federico @ 2007-05-24 08:56 UTC (permalink / raw)
To: pgsql-admin
Hi,
I'm writing some papers about PostgreSQL physical storage and I'm
bumping into the HeapTupleHeaderData layout as descripted here
http://www.postgresql.org/docs/8.2/static/storage-page-layout.html
Reading the source code in src/include/access/htup.h I got a question.
The t_cmin and t_cmax stores the insert and delete CID stamps.
the CID (command that operate on item id?) is similar to XID? where I
can find some docs about CID and its meaning?
Thank you very much in advance.
Regards
Federico
--
Federico Campoli is:
@ PGDay -> Committee, http://www.pgday.it
@ PLUG -> Consigliere, http://www.prato.linux.it
PostgreSQL Consulting -> PGHost http://www.pghost.eu
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Question about HeapTupleHeaderData
2007-05-24 08:56 Question about HeapTupleHeaderData Federico <rotellaro@gmail.com>
@ 2007-05-25 14:30 ` Alvaro Herrera <alvherre@commandprompt.com>
0 siblings, 0 replies; 2+ messages in thread
From: Alvaro Herrera @ 2007-05-25 14:30 UTC (permalink / raw)
To: Federico <rotellaro@gmail.com>; +Cc: pgsql-admin
Federico escribió:
> Hi,
> I'm writing some papers about PostgreSQL physical storage and I'm
> bumping into the HeapTupleHeaderData layout as descripted here
> http://www.postgresql.org/docs/8.2/static/storage-page-layout.html
>
> Reading the source code in src/include/access/htup.h I got a question.
>
> The t_cmin and t_cmax stores the insert and delete CID stamps.
> the CID (command that operate on item id?) is similar to XID? where I
> can find some docs about CID and its meaning?
CID is shorthand for CommandId. Each tuple created or destroyed in a
transaction is marked with the creation CommandId (cmin) and the
destruction CommandId (cmax). A later command in the transaction should
not be able to see a tuple destroyed by an earlier command; and an
earlier command should not be able to see a tuple created by a later
command.
This mechanism is there to solve the so-called Halloween Problem.
http://blogs.ittoolbox.com/database/technology/archives/what-is-the-halloween-problem-in-databases-1...
The current CommandId in a transaction is incremented each time an
UPDATE/INSERT/SELECT/DELETE (etc) operation is performed. Some utility
commands (CREATE TABLE, etc) may increment the command counter more than
once (internal implementation detail you should not care about).
--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2007-05-25 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-24 08:56 Question about HeapTupleHeaderData Federico <rotellaro@gmail.com>
2007-05-25 14:30 ` Alvaro Herrera <alvherre@commandprompt.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox