Re: explain plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rudy <rudy(at)heymax(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: explain plan
Date: 2001-02-03 19:02:28
Message-ID: 2458.981226948@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

rudy <rudy(at)heymax(dot)com> writes:
> skyy=# explain select id_article from article where id_article = 21;
> NOTICE: QUERY PLAN:

> Seq Scan on article (cost=0.00..1.61 rows=1 width=8)

> This table has 20,000 records.

It does? Given that cost estimate for a sequential scan, I don't
believe the table could have more than one page or more than
fifty records. What do you get from
select relpages, reltuples from pg_class where relname = 'article';

> Why doesn't it use the Index I created?

Because it thinks the seqscan is cheaper.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Francisco Reyes 2001-02-03 19:06:09 RE: [NOVICE] RE: Sizing of LARGE databases.
Previous Message Nabil Sayegh 2001-02-03 16:48:28 CUG