Re: Index scan / Index cond limitation or ? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Index scan / Index cond limitation or ?
Date
Msg-id 7091.1287167367@sss.pgh.pa.us
Whole thread Raw
In response to Index scan / Index cond limitation or ?  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Responses Re: Index scan / Index cond limitation or ?
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Tony Capobianco
Date:
Subject: Re: oracle to psql migration - slow query in postgres
Next
From: Tom Lane
Date:
Subject: Re: help with understanding EXPLAIN and boosting performance