Re: Slow query after upgrade from 9.0 to 9.2 - Mailing list pgsql-performance

From Andrzej Zawadzki
Subject Re: Slow query after upgrade from 9.0 to 9.2
Date
Msg-id 50EFC9B1.5060604@wp.pl
Whole thread Raw
In response to Re: Slow query after upgrade from 9.0 to 9.2  (Jeff Janes <jeff.janes@gmail.com>)
Responses Re: Slow query after upgrade from 9.0 to 9.2
List pgsql-performance
On 10.01.2013 19:17, Jeff Janes wrote:
> On Thu, Jan 10, 2013 at 5:32 AM, Andrzej Zawadzki <zawadaa@wp.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


pgsql-performance by date:

Previous
From: Charles Gomes
Date:
Subject: Re: Partition insert trigger using C language
Next
From: Andrzej Zawadzki
Date:
Subject: Re: Slow query after upgrade from 9.0 to 9.2