Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVolI-0004sG-Im for pgsql-performance@postgresql.org; Tue, 06 Nov 2012 19:24:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TVolH-0001Cw-EU for pgsql-performance@postgresql.org; Tue, 06 Nov 2012 19:24:35 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qA6JOYf9017867; Tue, 6 Nov 2012 14:24:34 -0500 (EST) From: Tom Lane To: Rodrigo Rosenfeld Rosas cc: Merlin Moncure , pgsql-performance@postgresql.org Subject: Re: Query completed in < 1s in PG 9.1 and ~ 700s in PG 9.2 In-reply-to: <50995D7C.9020108@gmail.com> References: <509944DE.6020400@gmail.com> <5099525B.5070909@gmail.com> <50995D7C.9020108@gmail.com> Comments: In-reply-to Rodrigo Rosenfeld Rosas message dated "Tue, 06 Nov 2012 16:57:00 -0200" Date: Tue, 06 Nov 2012 14:24:34 -0500 Message-ID: <17866.1352229874@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) X-Archive-Number: 201211/68 X-Sequence-Number: 48434 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? 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. regards, tom lane