pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jim@nasby.net>
To: Hannu Krosing <hannu@tm.ee>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: More tablescanning fun
Date: Fri, 25 Apr 2003 11:56:13 -0500
Message-ID: <20030425115613.E66185@flake.decibel.org> (raw)
In-Reply-To: <1051288086.1765.95.camel@fuji.krosing.net>
References: <20030424183817.A66185@flake.decibel.org>
	<3660.1051228710@sss.pgh.pa.us>
	<20030424235924.B66185@flake.decibel.org>
	<1051288086.1765.95.camel@fuji.krosing.net>

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?"




view thread (11+ messages)  latest in thread

Message-ID: <20030425115613.E66185@flake.decibel.org>
Permalink:  ../20030425115613.E66185@flake.decibel.org/
Also on:    postgresql.org/message-id/20030425115613.E66185@flake.decibel.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: jim@nasby.net, hannu@tm.ee, tgl@sss.pgh.pa.us
  Subject: Re: More tablescanning fun
  In-Reply-To: <20030425115613.E66185@flake.decibel.org>
  References: <20030424183817.A66185@flake.decibel.org> <3660.1051228710@sss.pgh.pa.us> <20030424235924.B66185@flake.decibel.org> <1051288086.1765.95.camel@fuji.krosing.net> <20030425115613.E66185@flake.decibel.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox