Re: Why is PostgreSQL 9.1 not using index for simple equality select

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why is PostgreSQL 9.1 not using index for simple equality select
Date: 2013-04-12 08:13:59
Message-ID: 5167C247.80500@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/12/2013 1:03 AM, Yang Zhang wrote:
> 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)

try EXPLAIN ANALYZE ..... its more useful.

my guess is, there's no statistics on this table, and doing an ANALYZE
lead; would rectify this.

--
john r pierce 37N 122W
somewhere on the middle of the left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Yang Zhang 2013-04-12 08:45:15 Re: Why is PostgreSQL 9.1 not using index for simple equality select
Previous Message Yang Zhang 2013-04-12 08:03:34 Why is PostgreSQL 9.1 not using index for simple equality select