Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWCFQ-0007WB-EQ for pgsql-performance@postgresql.org; Wed, 07 Nov 2012 20:29:16 +0000 Received: from mail-ye0-f174.google.com ([209.85.213.174]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWCFO-00063z-My for pgsql-performance@postgresql.org; Wed, 07 Nov 2012 20:29:15 +0000 Received: by mail-ye0-f174.google.com with SMTP id m12so436420yen.19 for ; Wed, 07 Nov 2012 12:29:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=mUvG4anNRAtY0n96h6FHHDhgxpxMUU+olJKmSrfNh2A=; b=wwlZOomyqHT9h4HCsiHFEIuHajfMuQJtZgtxyOAQ55X6Oe85NXf50oQEo//DikELNP vt0AoepSYjAtT4WRIowsPY3S9SDOFKbrcyD3amZw/g2eFGNbSnAJVbHaOgdUxFS9GjmU P8IeCt1OqRTRvCWxNkMHFF0OUuHFCxh8UOr0Qbb/tRUyeqLnRMaZetXr5QB5V0xf78tl BQkXriZ7riZQ1EX2RjmAmfcXTwmYMMLYuQBADNJWxIv3S4Xv6S8/IK33X/tBvh7Q2J3b 7GTdh+bx0HlNP0e6V82TjntMLdGr70T/26Bl2buNu3ctlLZqiahcP6lfHKIBCepCVVI8 xvQQ== Received: by 10.236.197.5 with SMTP id s5mr5959233yhn.114.1352320153502; Wed, 07 Nov 2012 12:29:13 -0800 (PST) Received: from [187.36.241.94] ([187.36.241.94]) by mx.google.com with ESMTPS id i26sm14179053yhc.10.2012.11.07.12.29.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Nov 2012 12:29:12 -0800 (PST) Message-ID: <509AC497.8070001@gmail.com> Date: Wed, 07 Nov 2012 18:29:11 -0200 From: Rodrigo Rosenfeld Rosas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121027 Icedove/10.0.10 MIME-Version: 1.0 To: Merlin Moncure CC: Tom Lane , pgsql-performance@postgresql.org Subject: Re: Query completed in < 1s in PG 9.1 and ~ 700s in PG 9.2 References: <509944DE.6020400@gmail.com> <5099525B.5070909@gmail.com> <50995D7C.9020108@gmail.com> <17866.1352229874@sss.pgh.pa.us> <50996583.2080703@gmail.com> <18371.1352231105@sss.pgh.pa.us> <509A42F9.6040403@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/97 X-Sequence-Number: 48463 Em 07-11-2012 14:34, Merlin Moncure escreveu: > On Wed, Nov 7, 2012 at 5:16 AM, Rodrigo Rosenfeld Rosas > wrote: >> Em 06-11-2012 19:11, Merlin Moncure escreveu: >> >>> On Tue, Nov 6, 2012 at 1:45 PM, Tom Lane wrote: >>>> Rodrigo Rosenfeld Rosas writes: >>>>> Em 06-11-2012 17:24, Tom Lane escreveu: >>>>>> Can you put together a self-contained test case to duplicate these >>>>>> results? I'm prepared to believe there's some sort of planner >>>>>> regression involved here, but we'll never find it without a test case. >>>>> I'd love to, but I'm afraid I won't have time to do this any time soon. >>>>> Maybe on Sunday. I'll see if I can get a script to generate the database >>>>> on Sunday and hope for it to replicate the issue. >>>>> Would you mind if I coded it using Ruby? (can you run Ruby code in your >>>>> computer?) I mean, for filling with some sample data. >>>> No objection. >>> hm, wouldn't timing the time to generate a raw EXPLAIN (that is, >>> without ANALYZE) give a rough estimate of planning time? better to >>> rule it out before OP goes to the trouble... >> This was a great guess! Congrats, Merlin: > Heh -- that was tom's guess, not mine. What this does is confirm the > planner regression and that elevates the importance of Tom's request > to get sample data so we (he) can fix it. True, sorry :) So, thanks Tom! I have some good news. It seems I'll be able to send the schema after just stripping a few parts of the schema first. Right now I have to leave but I think I'll have some time to do this tomorrow, so I hope I can send you the test case tomorrow. As a curious note I tried running a query with 11 fields (instead of 14 fields like in the example I gave you) and I didn't experience any problems... Thank you very much you both!