Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVorn-00083S-5x for pgsql-performance@postgresql.org; Tue, 06 Nov 2012 19:31:19 +0000 Received: from mail-yh0-f46.google.com ([209.85.213.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVorl-0001LO-Rc for pgsql-performance@postgresql.org; Tue, 06 Nov 2012 19:31:18 +0000 Received: by mail-yh0-f46.google.com with SMTP id m54so170661yhm.19 for ; Tue, 06 Nov 2012 11:31:17 -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=a4DwhjwJo0Pv/R0lnbb2qK/mq/y1tNRfJuTwkEwjO4Y=; b=qwk2PmR22Y1/3lhPB2bfcyvB4R7th5ztj607lpSiKarMV5GNesAKxb5GDXorZ1ma64 xYMlhJbztNn3azXeJxwbfj2gekOes2gvxIt1jjDxzp0rD3CSrMAO4U3703CZFO1GdSsP GujIwgXSeyu5Lj1wk+/VZb7TPvgIpxi9bWY5pQuj+IkOtICuB916pOR8Ao6tDbIaKwzF Y/81s1g35IGn5a66RmUwRdYG7fJjqI9HcuYoPAOe4imOnozPRHm39Ir66rKmtlF4sa2T M/jaUQu5rWFrtxYy2VC6f2UGSm6/iHaRHQl2CqBDpC2lzVS2HJ9ac68QSa6PV/9/BbBv bCoQ== Received: by 10.236.151.51 with SMTP id a39mr2203434yhk.29.1352230277094; Tue, 06 Nov 2012 11:31:17 -0800 (PST) Received: from [187.36.244.195] ([187.36.244.195]) by mx.google.com with ESMTPS id j8sm19628090ank.21.2012.11.06.11.31.15 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Nov 2012 11:31:16 -0800 (PST) Message-ID: <50996583.2080703@gmail.com> Date: Tue, 06 Nov 2012 17:31:15 -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: Tom Lane CC: Merlin Moncure , 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> In-Reply-To: <17866.1352229874@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/69 X-Sequence-Number: 48435 Em 06-11-2012 17:24, Tom Lane escreveu: > Rodrigo Rosenfeld Rosas writes: >> Em 06-11-2012 16:42, Merlin Moncure escreveu: >>> Hm -- looking at your 'slow' 9.2 query, it is reporting that the query >>> took 3 seconds (reported times are in milliseconds). How are you >>> timing the data? What happens when you run explain analyze >>> from psql (as in, how long does it take)? >> The time I reported in the tables of my first message were the time >> reported by pgAdmin3 (compiled from source). >> But I get similar time when I run like this: >> time psql -p 5432 -f slow.sql db_name> slow-9.2-again.explain >> real 1m56.353s >> user 0m0.068s >> sys 0m0.020s >> slow-9.2-again.explain: http://explain.depesz.com/s/zF1 > But that again shows only five seconds runtime. If you repeat the query > several dozen times in a row, run the same way each time, do you get > consistent timings? Yes, the timings are consistent here. > 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. Right now I need to concentrate on getting a working solution for 9.1 and downgrade the database and work in several other requested fixes. That is why I'm out of time for writing this test case right now... I'll try to find some time on Sunday and will post here if I can replicate. Thank you so much! Rodrigo.