Re: Slow query after upgrade from 9.0 to 9.2

From: Andrzej Zawadzki <zawadaa(at)wp(dot)pl>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow query after upgrade from 9.0 to 9.2
Date: 2013-01-11 08:13:37
Message-ID: 50EFC9B1.5060604@wp.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 10.01.2013 19:17, Jeff Janes wrote:
> On Thu, Jan 10, 2013 at 5:32 AM, Andrzej Zawadzki <zawadaa(at)wp(dot)pl> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andrzej Zawadzki 2013-01-11 08:23:01 Re: Slow query after upgrade from 9.0 to 9.2
Previous Message Tom Lane 2013-01-11 01:07:34 Re: [PERFORM] Slow query: bitmap scan troubles