Re: Slow query performance on large table

Поиск
Список
Период
Сортировка
От Tomasz Myrta
Тема Re: Slow query performance on large table
Дата
Msg-id 3E64C1BF.4080704@klaster.net
обсуждение исходный текст
Ответ на Slow query performance on large table  ("Paul McKay" <paul_mckay@clearwater-it.co.uk>)
Список pgsql-performance
Paul McKay wrote:
> 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 ?
Changing 2 indexes into one both-fields index should improve
performance much.

create index ind_meas on measurement (assessment,time).

Regards,
Tomasz Myrta



В списке pgsql-performance по дате отправления:

Предыдущее
От: "Paul McKay"
Дата:
Сообщение: Slow query performance on large table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Slow query performance on large table