Re: Equivalent praxis to CLUSTERED INDEX?

From: "Jeremy Dunn" <jdunn(at)autorevenue(dot)com>
To: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Equivalent praxis to CLUSTERED INDEX?
Date: 2004-08-27 17:39:35
Message-ID: 007e01c48c5c$d15f4c60$4f01a8c0@jeremydunn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> -----Original Message-----
> From: pgsql-performance-owner(at)postgresql(dot)org
> [mailto:pgsql-performance-owner(at)postgresql(dot)org] On Behalf Of
> Bruce Momjian
> Sent: Friday, August 27, 2004 1:27 PM
> To: Adi Alurkar
> Cc: pgsql-performance(at)postgresql(dot)org
> Subject: Re: [PERFORM] Equivalent praxis to CLUSTERED INDEX?
>
>
>
> But what is the advantage of non-full pages in Oracle?
>

One advantage has to do with updates of variable-length columns, e.g.
varchars.

If the block is fully packed with data, an update to a varchar column
that makes the column wider, causes "row-chaining". This means that a
portion of the row is stored in a different data block, which may be
somewhere completely different in the storage array. Retrieving that
row (or even just that column from that row) as a unit may now require
additional disk seek(s).

Leaving some space for updates in each data block doesn't prevent this
problem completely, but mitigates it to a certain extent. If for
instance a row is typically inserted with a null value for a varchar
column, but the application developer knows it will almost always get
updated with some value later on, then leaving a certain percentage of
empty space in each block allocated to that table makes sense.

Conversely, if you know that your data is never going to get updated
(e.g. a data warehousing application), you might specify to pack the
blocks as full as possible. This makes for the most efficient data
retrieval performance.

- Jeremy

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Adi Alurkar 2004-08-27 17:39:38 Re: Equivalent praxis to CLUSTERED INDEX?
Previous Message Bruce Momjian 2004-08-27 17:27:07 Re: Equivalent praxis to CLUSTERED INDEX?