Re: explain plan - Mailing list pgsql-novice

From Tom Lane
Subject Re: explain plan
Date
Msg-id 2458.981226948@sss.pgh.pa.us
Whole thread Raw
In response to explain plan  (rudy <rudy@heymax.com>)
List pgsql-novice
rudy <rudy@heymax.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

pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: CUG
Next
From: Francisco Reyes
Date:
Subject: Re: CUG