Mitesh Shah writes:

> One follow up question.  In the example given, it says there are 36
> bytes for each row header and 4 bytes for each pointer to a tuple.  I'm
> not sure where these numbers (36 and 4) are coming from.  Are they
> standard for *every* table?  If my table has more than just two
> integers, for example, will each row header be more than 36 bytes?

More or less.  Quoth the source:

typedef struct HeapTupleHeaderData
{
        Oid                     t_oid;                  /* OID of this tuple -- 4 
bytes */

        CommandId       t_cmin;                 /* insert CID stamp -- 4 bytes each */
        CommandId       t_cmax;                 /* delete CommandId stamp */

        TransactionId t_xmin;           /* insert XID stamp -- 4 bytes each */
        TransactionId t_xmax;           /* delete XID stamp */

        ItemPointerData t_ctid;         /* current TID of this or newer tuple */
        int16           t_natts;                /* number of attributes */

        uint16          t_infomask;             /* various infos */

        uint8           t_hoff;                 /* sizeof() tuple header */

        /* ^ - 31 bytes - ^ */

        bits8           t_bits[MinHeapTupleBitmapSize / 8];
        /* bit map of NULLs */

        /* MORE DATA FOLLOWS AT END OF STRUCT */
} HeapTupleHeaderData;

Most of the fields are for maintaining information required for
transaction rollback and multi-version concurrency control, in case you
can't quite decode it.  ;-)

-- 
Peter Eisentraut      [EMAIL PROTECTED]       http://yi.org/peter-e/


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to