Re: EXPLAIN ANALYZE not considering primary and unique indices!

From: Joseph S <jks(at)selectacast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: EXPLAIN ANALYZE not considering primary and unique indices!
Date: 2007-08-27 13:24:21
Message-ID: fauja5$h4l$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How many rows are in this table?

Sanjay wrote:
> Hi All,
>
> Say I have a simple table WEBSITE(website_id int4 PRIMARY KEY, name
> VARCHAR(30)). While I try this:
>
> EXPLAIN ANALYZE SELECT * FROM WEBSITE WHERE website_id = 1
>
> the output is:
> --------------------------------------------------------------------------------------
> Seq Scan on website (cost=0.00..1.31 rows=1 width=162) (actual
> time=0.047..0.051 rows=1 loops=1)
> Filter: (website_id = 1)
> Total runtime: 0.102 ms
> ---------------------------------------------------------------------------------------
> Wondering why it is not using the index, which would have been
> automatically created for the primary key.
>
> Needing help.
>
> thanks
> Sanjay
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dawid Kuroczko 2007-08-27 13:24:26 Re: LDAP service lookup
Previous Message Max Zorloff 2007-08-27 13:18:19 Re: Shared memory usage