Re: Slow query performance on large table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow query performance on large table
Дата
Msg-id 23081.1046790781@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Slow query performance on large table  ("Paul McKay" <paul_mckay@clearwater-it.co.uk>)
Ответы Re: Slow query performance on large table
Re: Slow query performance on large table
Список 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 по дате отправления:

Предыдущее
От: Tomasz Myrta
Дата:
Сообщение: Re: Slow query performance on large table
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: Slow query performance on large table