From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nikolai Zhubr <n-a-zhubr@yandex.ru>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index scan / Index cond limitation or ?
Date: Fri, 15 Oct 2010 14:29:27 -0400
Message-ID: <7091.1287167367@sss.pgh.pa.us> (raw)
In-Reply-To: <4CB7268D.4060901@yandex.ru>
References: <4CB7268D.4060901@yandex.ru>
Nikolai Zhubr <n-a-zhubr@yandex.ru> writes:
> So, "in (1, 2)" condition is not in Index Cond anymore! Why is that? How
> can I push it back?
It thinks the indexscan condition is sufficiently selective already.
An = ANY condition like that will force multiple index searches,
one for each of the OR'd possibilities, so it's far from "free" to add
it to the index condition. The planner doesn't think it's worth it.
Perhaps on your real query it is, but there's not much point in
debating about the behavior on this toy table; without realistic
table sizes and up-to-date stats it's impossible to say whether that
choice is correct or not.
> SELECT version();
> PostgreSQL 8.3.1, compiled by Visual C++ build 1400
You really, really, really ought to be running 8.3.something-newer.
We didn't put out the last 11 8.3.x bugfix updates just because
we didn't have anything better to do.
regards, tom lane
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: tgl@sss.pgh.pa.us, n-a-zhubr@yandex.ru
Subject: Re: Index scan / Index cond limitation or ?
In-Reply-To: <7091.1287167367@sss.pgh.pa.us>
* 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