Re: Why is PostgreSQL 9.1 not using index for simple equality select - Mailing list pgsql-general

From Tom Lane
Subject Re: Why is PostgreSQL 9.1 not using index for simple equality select
Date
Msg-id 16193.1365775917@sss.pgh.pa.us
Whole thread Raw
In response to Why is PostgreSQL 9.1 not using index for simple equality select  (Yang Zhang <yanghatespam@gmail.com>)
Responses Re: Why is PostgreSQL 9.1 not using index for simple equality select
List pgsql-general
Yang Zhang <yanghatespam@gmail.com> writes:
>     db=> explain select * from lead where email = 'blah';
>                              QUERY PLAN
>     ------------------------------------------------------------
>      Seq Scan on lead  (cost=0.00..319599.38 rows=1 width=5108)
>        Filter: (email = 'blah'::text)
>     (2 rows)

That's awfully odd.  What data type is the "email" column?

It seems possible also that the index on it is marked invalid.  I'd have
expected \d to tell you so, but maybe you're using a version of psql that
doesn't know about that.  It'd be interesting to look at
select * from pg_index where indexrelid = 'index name here'::regclass;


            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Automatic restart while upgrade
Next
From: Yang Zhang
Date:
Subject: Re: Why is PostgreSQL 9.1 not using index for simple equality select