Re: browsing table with 2 million records

Поиск
Список
Период
Сортировка
От aurora
Тема Re: browsing table with 2 million records
Дата
Msg-id cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: browsing table with 2 million records  (Mark Lewis <mark.lewis@mir3.com>)
Ответы Re: browsing table with 2 million records  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
>>   select * from table order by date limit 25 offset 0

> Do you have an index on the date column?  Can you post an EXPLAIN
> ANALYZE for the slow query?

Wow! Now that I look again there are actually 2 date fields. One is indexed and one is not. Order by was done on the column without index. Using the indexed column turn a seq scan into index scan and the query performance is totally fine now.

It would still be helpful if select count(*) can perform well.

Thanks!

Wy

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: browsing table with 2 million records
Следующее
От: Alex Turner
Дата:
Сообщение: Re: browsing table with 2 million records