Re: pg 7.4.rc1, Range query performance - Mailing list pgsql-sql

From Bruce Momjian
Subject Re: pg 7.4.rc1, Range query performance
Date
Msg-id 200311110050.hAB0ouQ11856@candle.pha.pa.us
Whole thread Raw
In response to Re: pg 7.4.rc1, Range query performance  (ow <oneway_111@yahoo.com>)
Responses Re: pg 7.4.rc1, Range query performance
List pgsql-sql
ow wrote:
> Hi,
> 
> I tried CLUSTER and it did improve performance, somewhat. The query against
> "clustered" table performs about five (5) times better than the same table but
> "non-clustered". However, even after that table was clustered, the difference
> in performance between single record query and range query is significant:
> 
> table Test (see below) has 10M records
>   single record - 31 ms and remains mostly constant as table grows
>   range query returning 30 records - about 10 secs and grows together with the
> table
> 
> Also, CLUSTER is locking the table (in our case this also means locking the
> database), so it may be impossible to use it in production on large tables
> (impossible in our case).
> 
> It feels like I really have a problem here. Any ideas? Thanks
> 
> P.S. For the future I would consider implementing "CREATE [CLUSTERED] INDEX"

Strange 30 records takes 30x the time than one record.  Can you run
ANALYZE and send us an EXPLAIN of the query to make sure it hasn't
changed?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-sql by date:

Previous
From: ow
Date:
Subject: Re: pg 7.4.rc1, Range query performance
Next
From: Stephan Szabo
Date:
Subject: Re: pg 7.4.rc1, Range query performance