Re: Slow query performance on large table - Mailing list pgsql-performance

From Tom Lane
Subject Re: Slow query performance on large table
Date
Msg-id 23081.1046790781@sss.pgh.pa.us
Whole thread Raw
In response to Slow query performance on large table  ("Paul McKay" <paul_mckay@clearwater-it.co.uk>)
Responses Re: Slow query performance on large table
Re: Slow query performance on large table
List pgsql-performance
"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

pgsql-performance by date:

Previous
From: Tomasz Myrta
Date:
Subject: Re: Slow query performance on large table
Next
From: Andrew Sullivan
Date:
Subject: Re: Slow query performance on large table