pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: Ron Mayer <rm_pg@cheapcomplexdevices.com>
Cc: pgsql-patches@postgresql.org
Subject: Re: [HACKERS] Maintaining cluster order on insert
Date: Sat, 12 Aug 2006 00:16:58 +0100
Message-ID: <44DD0FEA.8070002@enterprisedb.com> (raw)
In-Reply-To: <ebipoh$1538$1@news.hub.org>
References: <44DA31B1.3090700@enterprisedb.com>
	<28914.1155154622@sss.pgh.pa.us>
	<36e682920608091347m4e075a8cv6a04e3c4d97ed6f4@mail.gmail.com>
	<430d92a20608091831w6e59da84k48a58110cb98e8d6@mail.gmail.com>
	<9461.1155178183@sss.pgh.pa.us>
	<ebipoh$1538$1@news.hub.org>

Ron Mayer wrote:
> In my case my biggest/slowest tables are clustered by zip-code (which
> does a reasonable job at keeping counties/cities/etc on the
> same pages too).  Data comes in constantly (many records per minute, as
> we ramp up), pretty uniformly across the country; but most queries
> are geographically bounded.  The data's pretty much insert-only.

No deletes? If the tables grow over time, you probably would need to run 
CLUSTER every now and then to get the best performance, though the patch 
would alleviate that quite a lot.

Do you have a development environment where you could test what effect 
the patch would have? It would be interesting to have a real-world use 
case, since I don't have one myself at the moment.

> If I understand Heikki's patch, it would help for this use case.

Yes, it would.

> > Your best bet might be to partition the table into two subtables, one
> > with "stable" data and one with the fresh data, and transfer rows from
> > one to the other once they get stable.  Storage density in the "fresh"
> > part would be poor, but it should be small enough you don't care.
>
> Hmm... that should work well for me too.  Not sure if the use-case
> I mentioned above is still compelling anymore; since this seems like
> it'd give me much of the benefit; and I don't need an excessive
> fillfactor on the stable part of the table.

Umm, if your inserts are uniformly distributed across the country, you 
wouldn't have a stable part, right?

- Heikki



view thread (46+ messages)  latest in thread

Message-ID: <44DD0FEA.8070002@enterprisedb.com>
Permalink:  ../44DD0FEA.8070002@enterprisedb.com/
Also on:    postgresql.org/message-id/44DD0FEA.8070002@enterprisedb.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: heikki@enterprisedb.com, rm_pg@cheapcomplexdevices.com, pgsql-patches@postgresql.org
  Subject: Re: [HACKERS] Maintaining cluster order on insert
  In-Reply-To: <44DD0FEA.8070002@enterprisedb.com>

* 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