X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 6148011F660D for ; Sun, 16 Apr 2006 22:35:54 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.152 X-Spam-Level: X-Spam-Status: No, score=-2.152 required=5 tests=[AWL=0.449, BAYES_00=-2.599, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id r9qXd3M+t1DM for ; Sun, 16 Apr 2006 22:35:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 51AC311F65BF for ; Sun, 16 Apr 2006 22:35:51 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3H1ZovL020148; Sun, 16 Apr 2006 21:35:51 -0400 (EDT) To: "Mikael Carneholm" cc: "Pgsql performance" Subject: Re: Migration study, step 2: rewriting queries In-reply-to: <7F10D26ECFA1FB458B89C5B4B0D72C2B3E3CF0@sesrv12.wirelesscar.com> References: <7F10D26ECFA1FB458B89C5B4B0D72C2B3E3CF0@sesrv12.wirelesscar.com> Comments: In-reply-to "Mikael Carneholm" message dated "Mon, 17 Apr 2006 01:24:20 +0200" Date: Sun, 16 Apr 2006 21:35:50 -0400 Message-ID: <20147.1145237750@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200604/353 X-Sequence-Number: 18437 "Mikael Carneholm" writes: > ..and this last AND seems unnessecary, since the predicate on > (driver_activity_type__id = 5) is included in each of the above > conditions. This should be fixed by the changes I made recently in choose_bitmap_and --- it wasn't being aggressive about pruning overlapping AND conditions when a sub-OR was involved. It's possible the new coding is *too* aggressive, and will reject indexes that it'd be profitable to include; but at least it won't make this particular mistake. regards, tom lane