>>
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
- Re: [PERFORM] browsing table with 2 million record... aurora
- Re: [PERFORM] browsing table with 2 million r... Tom Lane
- Re: [PERFORM] browsing table with 2 million r... Alex Turner
- Re: [PERFORM] browsing table with 2 million r... PFC
- Re: [PERFORM] browsing table with 2 milli... Christopher Kings-Lynne
- Re: [PERFORM] browsing table with 2 million r... Christopher Kings-Lynne
- Re: [PERFORM] browsing table with 2 million r... Merlin Moncure