Re: Slow query performance on large table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Paul McKay" <paul_mckay(at)clearwater-it(dot)co(dot)uk>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query performance on large table
Date: 2003-03-04 15:13:01
Message-ID: 23081.1046790781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Paul McKay" <paul_mckay(at)clearwater-it(dot)co(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrew Sullivan 2003-03-04 15:15:29 Re: Slow query performance on large table
Previous Message Tomasz Myrta 2003-03-04 15:09:51 Re: Slow query performance on large table