X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 3B22E9FB1FB for ; Thu, 27 Jul 2006 19:22:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 61246-10 for ; Thu, 27 Jul 2006 19:22:25 -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 48A069FB21C for ; Thu, 27 Jul 2006 19:22:18 -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 k6RMM5Pm013634; Thu, 27 Jul 2006 18:22:05 -0400 (EDT) To: Ioana Danes cc: pgsql-performance@postgresql.org Subject: Re: Query plan issue when upgrading to postgres 8.14 (from In-reply-to: <20060727185507.9604.qmail@web55902.mail.re3.yahoo.com> References: <20060727185507.9604.qmail@web55902.mail.re3.yahoo.com> Comments: In-reply-to Ioana Danes message dated "Thu, 27 Jul 2006 14:55:06 -0400" Date: Thu, 27 Jul 2006 18:22:05 -0400 Message-ID: <13633.1154038925@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.036 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200607/250 X-Sequence-Number: 20110 Ioana Danes writes: > Does anyone now what the problem is with the following select when upgrading to postgresql 8.1.4 the query plan does not use the indexes as in postgresql 8.0.3. The planner doesn't have enough information about the correlation between testtype and testid to guess that the index-driven max() optimization doesn't work well in this case. But I see you've already found the solution ... regards, tom lane