Re: On-disk Tuple Size

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: On-disk Tuple Size
Date: 2002-04-21 19:10:41
Message-ID: 14279.1019416241@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Curt Sampson <cjs(at)cynic(dot)net> writes:
> Yes, this uses a bit more CPU, but I think it's going to be a pretty
> trivial amount. It's a short list, and since you're touching the data
> anyway, it's going to be in the CPU cache. The real cost you'll pay is
> in the time to access the area of memory where you're storing the sorted
> list of line pointers. But the potential saving here is up to 5% in I/O
> costs (due to using less disk space).

At this point you're essentially arguing that it's faster to recompute
the list of item sizes than it is to read it off disk. Given that the
recomputation would require sorting the list of item locations (with
up to a couple hundred entries --- more than that if blocksize > 8K)
I'm not convinced of that.

Another difficulty is that we'd lose the ability to record item sizes
to the exact byte. What we'd reconstruct from the item locations are
sizes rounded up to the next MAXALIGN boundary. I am not sure that
this is a problem, but I'm not sure it's not either.

The part of this idea that I actually like is overlapping the status
bits with the low order part of the item location, using the assumption
that MAXALIGN is at least 4. That would allow us to support BLCKSZ up
to 64K, and probably save a cycle or two in fetching/storing the item
fields as well. The larger BLCKSZ limit isn't nearly as desirable
as it used to be, because of TOAST, and in fact it could be a net loser
because of increased WAL traffic. But it'd be interesting to try it
and see.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Curt Sampson 2002-04-21 19:50:55 Re: On-disk Tuple Size
Previous Message Michael Loftis 2002-04-21 15:08:56 Re: phpPgAdmin problem login

Browse pgsql-hackers by date

  From Date Subject
Next Message "." 2002-04-21 19:34:41 Re: [INTERFACES] sqlbang
Previous Message Curt Sampson 2002-04-21 19:03:04 Re: Schema (namespace) privilege details