Re: Unexpected sequential scan on an indexed column - Mailing list pgsql-performance

From Tom Lane
Subject Re: Unexpected sequential scan on an indexed column
Date
Msg-id 25265.1258326350@sss.pgh.pa.us
Whole thread Raw
In response to Unexpected sequential scan on an indexed column  (Eddy Escardo-Raffo <eescardo@kikini.com>)
List pgsql-performance
Eddy Escardo-Raffo <eescardo@kikini.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

pgsql-performance by date:

Previous
From: Eddy Escardo-Raffo
Date:
Subject: Unexpected sequential scan on an indexed column
Next
From: david@lang.hm
Date:
Subject: Re: limiting performance impact of wal archiving.