Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtZkH-0007O9-Fr for pgsql-performance@arkaria.postgresql.org; Fri, 11 Jan 2013 08:13:46 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TtZkF-0006o2-Q2 for pgsql-performance@arkaria.postgresql.org; Fri, 11 Jan 2013 08:13:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtZkE-0006nw-P0 for pgsql-performance@postgresql.org; Fri, 11 Jan 2013 08:13:42 +0000 Received: from mx4.wp.pl ([212.77.101.8]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TtZkB-0000Vw-NR for pgsql-performance@postgresql.org; Fri, 11 Jan 2013 08:13:42 +0000 Received: (wp-smtpd smtp.wp.pl 32274 invoked from network); 11 Jan 2013 09:13:37 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1357892017; bh=U9KeSOnxvWbSsLkH6ld05hcYCyygUbLTdFC4AHuzpIs=; h=From:To:CC:Subject; b=viQq6t8xq/hK6Y0/lkSk4Cg2sU6g0KzdYZs+giME9Mx33esAu27pFkm57Nacx6o2v H3g1f+DTtx5DXEWtuY54wCj6WL2JTn5qO2H4D7Uql250eYFAlMOIORY5qoex5zkvHO y3dbBTxAifMfwmiTMH+okFUE5/SJE2Fa/79kmmA8= Received: from 89-73-238-104.dynamic.chello.pl (HELO [192.168.0.13]) (zawadaa@[89.73.238.104]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with CAMELLIA256-SHA encrypted SMTP for ; 11 Jan 2013 09:13:37 +0100 Message-ID: <50EFC9B1.5060604@wp.pl> Date: Fri, 11 Jan 2013 09:13:37 +0100 From: Andrzej Zawadzki User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Icedove/17.0.2 MIME-Version: 1.0 To: Jeff Janes CC: pgsql-performance@postgresql.org Subject: Re: Slow query after upgrade from 9.0 to 9.2 References: <50EEC2D5.3050602@wp.pl> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [wXPk] X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 10.01.2013 19:17, Jeff Janes wrote: > On Thu, Jan 10, 2013 at 5:32 AM, Andrzej Zawadzki wrote: >> Why that's happens? All configurations are identical. Only engine is >> different. > Could you post explain (analyze, buffers) instead of just explain? Impossible, 1h of waiting and I've killed that. > Also, if you temporarily set enable_seqscan=off on 9.2, what plan do > you then get? Plan is different. "Index Scan using sygma_arrear_credit_id on sygma_arrear sar (cost=11.07..390.66 rows=1 width=265)" " Index Cond: (credit_id = 3102309)" " Filter: ((arrear_import_id = $0) AND (arrear_flag_id = 2))" " InitPlan 1 (returns $0)" " -> Limit (cost=0.00..11.07 rows=1 width=8)" " -> Nested Loop (cost=0.00..54961299.49 rows=4963314 width=8)" " Join Filter: (sa.arrear_import_id = ai.id)" " -> Index Scan Backward using report_date_bank_id_key on arrear_import ai (cost=0.00..62.81 rows=469 width=8)" " Filter: (import_type_id = 1)" " -> Materialize (cost=0.00..574515.68 rows=6138000 width=4)" " -> Index Scan using sygma_arrear_arrear_import_id_idx on sygma_arrear sa (cost=0.00..519848.68 rows=6138000 width=4)" " Filter: (arrear_flag_id = 2)" The real query is still slow. -- Andrzej Zawadzki -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance