Gregory Stark <[EMAIL PROTECTED]> writes:

> Tom Lane <[EMAIL PROTECTED]> writes:
> 
> > The performance costs of that seem pretty daunting, however, especially when
> > you reflect that simply stepping over a varlena field would require
> > memcpy'ing its length word to someplace.
> 
> I think if you give up on disk and in-memory representations being the same
> then there are ways of finessing that. For example you could have all the
> lengths together in the header prior to the variable length fields.

Hm, this might have nice cache effects when reading in a tuple too. Since all
the lengths would likely fit in a single cache line and probably the same
cache line as the null bitmap even it means you can find all the offsets
without actually having to bring in the rest of the tuple into the processor.

I don't think that alone would be enough to outweigh the costs of having to
convert to an in-memory representation though. Even if that was still just a
pointer to the buffer memory in the simple case.

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


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to