pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul McKay <paul_mckay@clearwater-it.co.uk>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow query performance on large table
Date: Tue, 04 Mar 2003 10:13:01 -0500
Message-ID: <23081.1046790781@sss.pgh.pa.us> (raw)
In-Reply-To: <000001c2e25c$ad506170$0c64a8c0@paulspc>
References: <000001c2e25c$ad506170$0c64a8c0@paulspc>

"Paul McKay" <paul_mckay@clearwater-it.co.uk> writes:
> The query I am executing is
> Select time,value
> From measurement
> Where assessment = ?
> And time between ? and ?

EXPLAIN ANALYZE would help you investigate this.  Is it using an
indexscan?  On which index?  Does forcing use of the other index
(by temporarily dropping the preferred one) improve matters?

Possibly a two-column index on both assessment and time would be
an improvement, but it's hard to guess without knowing anything
about the selectivity of the two WHERE clauses.

			regards, tom lane



view thread (18+ messages)  latest in thread

Message-ID: <23081.1046790781@sss.pgh.pa.us>
Permalink:  ../23081.1046790781@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23081.1046790781@sss.pgh.pa.us

 · 

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

* 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