Re: Seq Scans when index expected to be used

From: ow <oneway_111(at)yahoo(dot)com>
To: Joe Conway <mail(at)joeconway(dot)com>, jasiek <jasiek(at)klaster(dot)net>
Cc: ow <oneway_111(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Seq Scans when index expected to be used
Date: 2003-11-29 18:01:59
Message-ID: 20031129180159.91794.qmail@web21404.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


--- Joe Conway <mail(at)joeconway(dot)com> wrote:
> >
> >>explain select b, c, a
> >>from test
> >>group by b, c, a
> >>having count(*) > 1
>
> Why would you expect this to use an index scan when it needs to read the
> entire table? If you read the whole table (or even a significant
> fraction of it), a seq scan is faster.

My impression was that the index "I_bca" covers the query, hence there should
not be a need to go to the table itself. Why would it?

P.S.
explain analyze vs explain. Normally, would've used "explain analyze" but in
this case it's taking way too long so I used "explain".

Thanks

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Heissenberger 2003-11-29 18:18:46 Updating session id based on accesstimeout
Previous Message Andreas Heissenberger 2003-11-29 17:58:29