Re: Index scan / Index cond limitation or ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikolai Zhubr <n-a-zhubr(at)yandex(dot)ru>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Index scan / Index cond limitation or ?
Date: 2010-10-15 18:29:27
Message-ID: 7091.1287167367@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Nikolai Zhubr <n-a-zhubr(at)yandex(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2010-10-15 18:35:03 Re: help with understanding EXPLAIN and boosting performance
Previous Message Steve Francis 2010-10-15 18:15:37 Re: Postgres log file