Michael Glaesemann <grzm@seespotcode.net> writes:
> The planner will choose a seq scan if it thinks that it will be
> faster than using an index: if based on its statistics it thinks a
> large portion of rows will match the criteria, a seq scan may well be
> faster than an index scan.
> Have you analyzed recently?
If you've never analyzed at all, the default assumptions will
discourage the planner from using an indexscan for a one-sided
inequality condition (like "x > constant"). On the other hand,
it usually will use an indexscan for a range inequality (like
"x > constant1 and x < constant2", or a BETWEEN construct).
If you do have ANALYZE stats then it all depends on what fraction of
the column's range is selected by the inequality or range condition.
regards, tom lane