Re: browsing table with 2 million records

From: aurora <aurora00(at)gmail(dot)com>
To: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: browsing table with 2 million records
Date: 2005-10-26 21:22:58
Message-ID: cbd177510510261422h17f277d3w92c834164cf75a4e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Alex Turner 2005-10-26 21:28:36 Re: browsing table with 2 million records
Previous Message Joshua D. Drake 2005-10-26 21:09:37 Re: browsing table with 2 million records