Re: A thought on Index Organized Tables - Mailing list pgsql-hackers

From Gokulakannan Somasundaram
Subject Re: A thought on Index Organized Tables
Date
Msg-id 9362e74e1002251412v31e28292g9604de79d5558de8@mail.gmail.com
Whole thread Raw
In response to Re: A thought on Index Organized Tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: A thought on Index Organized Tables
List pgsql-hackers

Wait a second, which idea are we currently talking about?  No heap at
all, or just the ability to check visibility without visiting the heap?

I was talking about the indexes with snapshot
 

If it's a genuine IOT (ie no separate heap), then you are not going to
be able to get away without a full heap tuple header.  We've sweated
blood to get that struct down to where it is; there's no way to make it
smaller without giving up some really fundamental things, for example
the ability to do UPDATE :-(

Of course, as i said, the leaf pages will have HeapTuples in IOT. As a Postgres user, definitely i am thankful for what has been done.


If you just want to avoid a heap visit for visibility checks, I think
you'd only need to add xmin/xmax/cmin plus the hint bits for same.
This is going to end up costing 16 bytes in practice --- you might
think you could squeeze into 12 but on 64-bit machines (MAXALIGN 8)
you'll save nothing.  So that's effectively a doubling of index size
for common cases such as a single int4 or int8 index column.  

Yes but currently we are storing the size of index in IndexTuple, which is also stored in ItemId. If we can somehow make it use that info, then we have 13 bits of flag for free and we can reduce it to 8 bytes of extra info. But we need you to sweat some more blood for that :). But again, unless we resolve the volatile functions issue, there is no use in worrying about this.
 
The other
problem is the extra write load created by needing to update the index's
copies of the hint bits; not to mention extra writes to freeze the xids
when they get old enough.
But Tom, i remember that the vacuum was faster when index had visibility info, since we need not touch the table. But maybe i am wrong. Atleast i remember that was the case, when the
relation had only thick indexes.
Oh..Yeah... visibility map might have changed the equation.


Thanks,
Gokul

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: feature request
Next
From: "Omar Bettin"
Date:
Subject: Re: feature request