From: Rick Schumeyer <rschumeyer@ieee.org>
To: 'Thomas F.O'Connell' <tfo@sitening.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: index scan on =, but not < ?
Date: Tue, 8 Mar 2005 14:02:50 -0500
Message-ID: <002801c52411$6d510f40$0200a8c0@dell8200> (raw)
In-Reply-To: <9b7a46c3c46a4fdf1beeef7eb5727493@sitening.com>
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.
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: rschumeyer@ieee.org, tfo@sitening.com
Subject: Re: index scan on =, but not < ?
In-Reply-To: <002801c52411$6d510f40$0200a8c0@dell8200>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox