Tim Perdue <tperdue@valinux.com> writes:
> explain SELECT mailid, mail_date, mail_is_followup, mail_from,
> mail_subject
> FROM mail_archive WHERE mail_list=35 AND mail_year=2000
> AND mail_month=1 ORDER BY mail_date DESC LIMIT 26 OFFSET 0;
> NOTICE: QUERY PLAN:
> Sort (cost=138.41..138.41 rows=34 width=44)
> -> Index Scan using idx_mail_archive_list_yr_mo on tbl_mail_archive
> (cost=0.00..137.55 rows=34 width=44)
Hard to tell with this much info. How many rows are actually retrieved
by the query (the planner is guessing 34, is that anywhere in the right
ballpark? How big is the table, anyway?)
Also, what's the definition of the index idx_mail_archive_list_yr_mo?
It might help to see the EXPLAIN VERBOSE output also --- I'm wondering
if all the WHERE clauses are getting used as index keys or not...
regards, tom lane