Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C05751337B66 for ; Wed, 27 Oct 2010 13:09:56 -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 66873-09 for ; Wed, 27 Oct 2010 16:09:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id A76061336FA7 for ; Wed, 27 Oct 2010 13:09:48 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9RG9ku4021878; Wed, 27 Oct 2010 12:09:46 -0400 (EDT) To: Francisco Reyes cc: Pgsql performance Subject: Re: Regression: 8.3 2 seconds -> 8.4 100+ seconds In-reply-to: References: Comments: In-reply-to Francisco Reyes message dated "Wed, 27 Oct 2010 08:41:23 -0400" Date: Wed, 27 Oct 2010 12:09:46 -0400 Message-ID: <21877.1288195786@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/477 X-Sequence-Number: 40895 Francisco Reyes writes: > CentOS 5.4 and 5.5 > Query > SELECT sum(usramt) as givensum, > sum (case when usedid > 0 then usramt else 0 end) as usedsum > FROM argrades > WHERE userstatus in (5) and > membid in (select distinct members.membid from members, cards > where members.membid = cards.membid and members.membershipid = 40 and useraccount in > ( select useraccount from cards where membid in > (select membid from members where commonid = 3594))) Please provide a self-contained test case for this. In testing here, 8.4 can still figure out that it ought to use an indexscan against the large table ... so there is some aspect of your tables that you're not showing us. regards, tom lane