Re: More tablescanning fun - Mailing list pgsql-performance

From Jim C. Nasby
Subject Re: More tablescanning fun
Date
Msg-id 20030425115613.E66185@flake.decibel.org
Whole thread Raw
In response to Re: More tablescanning fun  (Hannu Krosing <hannu@tm.ee>)
Responses Re: More tablescanning fun
List pgsql-performance
On Fri, Apr 25, 2003 at 07:28:06PM +0300, Hannu Krosing wrote:
> I have been pondering if keeping pages half-empty (or even 70% empty)
> could solve both clustering problems and longish updates for much data.
>
> If we could place the copy in the same page than original, most big
> updates would be possible by one sweep of disk heads and also clustering
> order would be easier to keep if pages were kept intentionally half
> empty.
>
> So "VACUUM FULL 65% EMPTY;" could make sense ?

That's actually a recommended practice, at least for sybase when you're
using a clustered index, depending on what you're using it for. If you
cluster a table in such a way that inserts will happen across the entire
table, you'll actually end up with a fillratio (amount of data v. empty
space on a page) of 75% over time, because of page splits. When sybase
goes to insert, if it can't find room on the page it needs to insert
into (keep in mind this is a clustered table, so a given row *must* go
into a given position), it will split that single page into two pages,
each of which will then have a fillratio of 50%. Of course they'll
eventually approach 100%, so the average fill ratio across all pages for
the table would be 75%.

I'm not familiar enough with pgsql's guts to know how big an impact
updates across pages are, or if they even happen often at all. If you're
not maintaining a clustered table, couldn't all updates just occur
in-place? Or are you thinking of the case where you have a lot of
variable-length stuff?
--
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


pgsql-performance by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: More tablescanning fun
Next
From: Tom Lane
Date:
Subject: Re: More tablescanning fun