Re: index scan on =, but not < ? - Mailing list pgsql-performance

From Rick Schumeyer
Subject Re: index scan on =, but not < ?
Date
Msg-id 002801c52411$6d510f40$0200a8c0@dell8200
Whole thread Raw
In response to Re: index scan on =, but not < ?  (Thomas F.O'Connell <tfo@sitening.com>)
List pgsql-performance
That makes a lot of sense.  Sure enough, if I change the query from
WHERE x > 0  (which return a lot of rows) to
WHERE x > 0 AND x < 1
I now get an index scan.

> As for why you see index usage in your first example query and not your
> second: compare the number of rows in question. An index is extremely
> useful if 19 rows will be returned. But when 62350411 rows will be
> returned, you're talking about a substantial fraction of the table. A
> sequential scan will probably correctly be judged to be faster by the
> planner.
>


pgsql-performance by date:

Previous
From: John Arbash Meinel
Date:
Subject: Re: index scan on =, but not < ?
Next
From: Dennis Bjorklund
Date:
Subject: Re: index scan on =, but not < ?