pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul McKay <paul_mckay@clearwater-it.co.uk>
To: pgsql-performance@postgresql.org
Subject: Slow query performance on large table
Date: Tue, 4 Mar 2003 14:45:18 -0000
Message-ID: <000001c2e25c$ad506170$0c64a8c0@paulspc> (raw)

Hi,

 

I am executing a query on a table:

 

           Table "public.measurement"

   Column   |         Type          | Modifiers

------------+-----------------------+-----------

 assessment | integer               |

 time       | integer               |

 value      | character varying(50) |

Indexes: idx_measurement_assessment btree (assessment),

         idx_measurement_time btree ("time")

 

The primary key of the table is a combination of assessment and time,
and there are indexes on both assessment and time.

 

The query I am executing is

 

Select time,value

From measurement

Where assessment = ?

And time between ? and ?

 

This used to run like a rocket before my database got a little larger.
There are now around 15 million rows in the table and it is taking a
long time to execute queries that get a fair number of rows back (c.300)

 

The database is  'VACUUM ANALYZED' regularly, and I've upped the shared
buffers to a significant amount.

 

I've tried it on various machine configurations now. A dual processor
Linux/Intel Machine with 1G of Memory, (0.5G shared buffers).  A single
processor Linux/Intel Machine (0.25G shared buffers) , and a Solaris
machine (0.25G shared buffers).  I'm getting similar performance on all
of them.

 

Anybody see anything I've obviously done wrong?  Any ways of improving
the performance of this query?

 

Thanks in advance.

 

Paul McKay.

 

 

======================================

Paul Mckay

Consultant Partner

Servicing Division

Clearwater-IT

e:paul_mckay@clearwater-it.co.uk

t:0161 877 6090

m: 07713 510946

======================================

 

view thread (18+ messages)  latest in thread

Message-ID: <000001c2e25c$ad506170$0c64a8c0@paulspc>
Permalink:  ../000001c2e25c$ad506170$0c64a8c0@paulspc/
Also on:    postgresql.org/message-id/000001c2e25c$ad506170$0c64a8c0@paulspc

 · 

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: paul_mckay@clearwater-it.co.uk
  Subject: Re: Slow query performance on large table
  In-Reply-To: <000001c2e25c$ad506170$0c64a8c0@paulspc>
  References: <000001c2e25c$ad506170$0c64a8c0@paulspc>

* 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