Re: Unexpected sequential scan on an indexed column

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eddy Escardo-Raffo <eescardo(at)kikini(dot)com>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Unexpected sequential scan on an indexed column
Date: 2009-11-15 23:05:50
Message-ID: 25265.1258326350@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Eddy Escardo-Raffo <eescardo(at)kikini(dot)com> writes:
> Do you guys have any idea why this is not working as I expect?

Datatype issue maybe? When I try what seems to be the same case here
I get the expected indexscan, so I'm thinking the problem is that
the comparison isn't indexable, which is a possibility if the location
column isn't actually integer.

The fact that it's estimating 1000000 rows out is also extremely
suspicious --- it might or might not get the exact "2" estimate,
but I'd sure expect it to know that the majority of rows don't match.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-11-15 23:33:56 Re: Unexpected sequential scan on an indexed column
Previous Message david 2009-11-15 22:54:42 Re: limiting performance impact of wal archiving.