Re: Page access pattern in query plan using index scan

From: Jack Orenstein <jao(at)geophile(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Page access pattern in query plan using index scan
Date: 2004-06-03 12:19:49
Message-ID: 40BF1765.2040304@geophile.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark wrote:

>>Can you recommend an application-level workaround that will access pages
>>in the right order?
>
>
> Well you could try CLUSTER-ing your table on that index.

For my application, the problem with CLUSTER is that it reclusters the entire
table. So as the table grows, the cost of CLUSTER goes up.

What would be really nice is something like "cluster recent". The idea is to
cluster only rows added since the last cluster. This amortizes the time and storage
costs of clustering across the invocations of cluster in a much more palatable way.
If such a command were used this wisely, (e.g. whenever the table grows by 20%) then
I suspect applications would obtain most of the benefit of a sort following an index
lookup. (And I'm guessing this is a much simpler development task.)

Admittedly, this would not work so well in cases where the index keys change in value.
But this would be a huge win in situations (like mine) where the keys never change.

Jack Orenstein

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Enrico Weigelt 2004-06-03 12:47:47 Re: PostgreSQL certifications?
Previous Message Hubert Fröhlich 2004-06-03 12:02:35 again, invalid page header in block ...