Re: [GENERAL] space-effective varchar(255)-like arrangement

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: honza(at)ied(dot)com (Jan Vicherek)
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] space-effective varchar(255)-like arrangement
Date: 1998-12-26 19:39:37
Message-ID: 199812261939.OAA04063@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> hmm, thus if one block has 8192 bytes, and if there is 9-byte overhead
> for each row, then I can store 390 rows in one block if, on average,
> "names" are 10 chars in length ? echo $[ 8192 / ( 9 + 10 + 2 ) ] # = 390

Yes. See FAQ for row overhead calculations.

> If each record has variable length, pg has no way of calculating where
> is start of next record, other than going through the block and summing up
> lengths of varchars to determine where does next record begin, right ?
> (above I use word "record" and "row" interchangeably).

It is not that bad. It knows where each record starts. It is finding
a certain field in the record that is a problem for any field AFTER the
first variable length field.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Vicherek 1998-12-26 19:42:46 Re: [GENERAL] space-effective varchar(255)-like arrangement
Previous Message Jan Vicherek 1998-12-26 19:32:17 Re: [GENERAL] space-effective varchar(255)-like arrangement