Re: Basic question about indexes/explain

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: Terry Yapt <pgsql(at)technovell(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Basic question about indexes/explain
Date: 2002-10-26 11:40:06
Message-ID: 200210261340.06876.mweilguni@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Am Samstag, 26. Oktober 2002 12:27 schrieb Terry Yapt:
> Hi all,
>
snip
> I have a basic doubt about indexes... in the next example:
> But if we have an index with the two colums I am using in the WHERE clause,
> why is the planner using seq scan ? (Or perhaps it is because too few rows
> in the table ?)....

First of all, you did not analyze your table (at least you did not mention you did). And an index is never a win for such a small table. I think the planner is fine here to select a seq scan, because your whole table is only 1 database page, so it would be no win to check the index here.

Everything is explained in the manual, check http://developer.postgresql.org/docs/postgres/indexes.html

regards,
mario weilguni

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2002-10-26 14:24:52 Re: Basic question about indexes/explain
Previous Message Terry Yapt 2002-10-26 10:27:28 Basic question about indexes/explain