Re: Seq scans on indexed columns.

From: Guillaume Cottenceau <gc(at)mnc(dot)ch>
To: Yannick Le Guédart <yannick(at)over-blog(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Seq scans on indexed columns.
Date: 2008-01-14 14:34:36
Message-ID: 87prw48ohv.fsf@messaging.mobileway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Yannick Le Guédart <yannick 'at' over-blog.com> writes:

> Greetings,
>
> I was trying to get informations on #portgresql about a query plan I
> think is quite strange, and I was said to post on this list. I hope my
> mail will be clear enough. I have included the query, the query plan,
> and the table definitions. I just don't understand the "Seq Scan" on
> fileds that are indexed.

This is a FAQ entry (curious that the people there didn't direct
you to the FAQ first):

http://www.postgresql.org/docs/faqs.FAQ.html#item4.6

It's possible that more than 800,000 rows is not a "small
percentage of the rows in the table", and also there's the fact
that "indexes are normally not used (..) to perform joins".

Also, your database may not be analyzed, or not properly tuned
(for example, it seems that the default random_page_cost of 4 is
too large for current disks - at least for us, we've found that 2
is more correct)

[...]

> -> Seq Scan on _user (cost=0.00..205537.72 rows=806972 width=24)

--
Guillaume Cottenceau, MNC Mobile News Channel SA, an Alcatel-Lucent Company
Av. de la Gare 10, 1003 Lausanne, Switzerland - direct +41 21 317 50 36

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2008-01-14 15:22:14 Re: Linux/PostgreSQL scalability issue - problem with 8 cores
Previous Message Yannick Le Guédart 2008-01-14 14:18:51 Seq scans on indexed columns.