Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2F0CA1337BD5 for ; Fri, 15 Oct 2010 17:47:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 44362-06 for ; Fri, 15 Oct 2010 20:47:05 +0000 (UTC) X-Greylist: delayed 00:07:39.906437 by SQLgrey-1.7.6 Received: from forward9.mail.yandex.net (forward9.mail.yandex.net [77.88.61.48]) by mail.postgresql.org (Postfix) with ESMTP id 5F1CB1337BCC for ; Fri, 15 Oct 2010 17:47:04 -0300 (ADT) Received: from smtp6.mail.yandex.net (smtp6.mail.yandex.net [77.88.61.56]) by forward9.mail.yandex.net (Yandex) with ESMTP id DB1A714D8C98; Sat, 16 Oct 2010 00:39:20 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1287175160; bh=XzEGAUXubaUE/34aU9sS3MMLWRn115ItnT6Ai/oEVBk=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=ukWZ3OtYTIhjMoLwcrmHVdnUD7k0iEdfTEANF+uVXgUn1chNFPEuGYxcIg490UGG2 5YL9HVxVZwY2pgj2mrG7YZ4dyk+n5xZfFSHGY1UsRVBYayEymy7sW8Okz222vN4k0G ZZsi6HNA73+tUjMGHb1L8EgGZoMlXhhqNPIzkHYU= Received: from [192.168.0.91] (unknown [94.242.50.174]) by smtp6.mail.yandex.net (Yandex) with ESMTPSA id B0349328089; Sat, 16 Oct 2010 00:39:20 +0400 (MSD) Message-ID: <4CB8C0D2.6000000@yandex.ru> Date: Sat, 16 Oct 2010 01:00:02 +0400 From: Nikolai Zhubr User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org Subject: Re: Index scan / Index cond limitation or ? References: <4CB7268D.4060901@yandex.ru> <7091.1287167367@sss.pgh.pa.us> In-Reply-To: <7091.1287167367@sss.pgh.pa.us> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Yandex-TimeMark: 1287175160 X-Yandex-Spam: 1 X-Yandex-Front: smtp6.mail.yandex.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201010/282 X-Sequence-Number: 40700 15.10.2010 22:29, Tom Lane: > Nikolai Zhubr 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. Aha, ok. It makes sense then. Is this specific case (=ANY in index cond) described somewhere with reasonable detail? I always try to RTFM first and most of the time I can find pretty good hints in the regular manual already (sufficient as a starting point at least) but this specific topic seems to be somewhat mysterious. > 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. Yes, I know, and I do appreciate the efforts of postgresql devels to create updates for older versions too. This server is internal-only (so it does not see any real world yet). Anyway, I hope to update everything to 9.0.1 soon. Thank you! Nikolai > > regards, tom lane > >