explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vrIr

Settings
# exclusive inclusive rows x rows loops node
1. 6.924 7,396.011 ↑ 442.5 80 1

Subquery Scan on credit_control_analysis (cost=1,620,348.36..1,630,968.96 rows=35,402 width=72) (actual time=7,342.514..7,396.011 rows=80 loops=1)

  • Filter: (credit_control_analysis.id = ANY ('{11068,11070,11071,11072,11073,11074,11075,11076,11077,11078,11079,11080,11081,11082,11083,11084,11085,11086,11087,11088,11089,11090,11091,11092,11093,11094,11095,11096,11097,11098,11099,11100,11101,11102,11103,11104,11105,11106,11107,11108,11109,11110,11111,11112,11113,11114,11115,11116,11117,11118,11119,11120,11121,11122,11123,11124,11125,11126,11127,11128,11129,11130,11131,11132,11134,11135,11136,11137,11138,11139,11140,11141,11142,11143,11144,11145,11146,11147,11148,11149}'::integer[]))
  • Rows Removed by Filter: 7541
2. 24.222 7,389.087 ↑ 11.6 7,621 1

Unique (cost=1,620,348.36..1,621,233.41 rows=88,505 width=76) (actual time=7,338.493..7,389.087 rows=7,621 loops=1)

3. 301.880 7,364.865 ↓ 1.0 91,850 1

Sort (cost=1,620,348.36..1,620,569.62 rows=88,505 width=76) (actual time=7,338.492..7,364.865 rows=91,850 loops=1)

  • Sort Key: partner.id, ccl.policy_id, ccl.currency_id, ccpl.level DESC, ccl.id
  • Sort Method: external sort Disk: 5040kB
4. 227.924 7,062.985 ↓ 1.0 91,850 1

Hash Left Join (cost=11,565.25..1,610,771.94 rows=88,505 width=76) (actual time=173.254..7,062.985 rows=91,850 loops=1)

  • Hash Cond: (ccl.policy_level_id = ccpl.id)
5. 161.501 1,140.335 ↓ 1.0 91,850 1

Hash Join (cost=11,548.50..46,325.00 rows=88,505 width=36) (actual time=172.925..1,140.335 rows=91,850 loops=1)

  • Hash Cond: (ccl.move_line_id = aml.id)
6. 95.566 809.795 ↑ 1.0 91,851 1

Merge Left Join (cost=106.58..31,491.59 rows=91,851 width=40) (actual time=3.135..809.795 rows=91,851 loops=1)

  • Merge Cond: (ccl.commercial_partner_id = partner.id)
7. 115.623 115.623 ↑ 1.0 91,851 1

Index Scan using credit_control_line_commercial_partner_id_index on credit_control_line ccl (cost=0.42..5,878.28 rows=91,851 width=24) (actual time=0.008..115.623 rows=91,851 loops=1)

8. 598.606 598.606 ↓ 1.1 272,445 1

Index Scan using res_partner_pkey on res_partner partner (cost=0.42..30,319.23 rows=237,673 width=20) (actual time=0.006..598.606 rows=272,445 loops=1)

9. 59.478 169.039 ↓ 1.0 185,994 1

Hash (cost=8,392.78..8,392.78 rows=185,851 width=4) (actual time=169.039..169.039 rows=185,994 loops=1)

  • Buckets: 131072 Batches: 2 Memory Usage: 4296kB
10. 109.561 109.561 ↓ 1.0 185,994 1

Seq Scan on account_move_line aml (cost=0.00..8,392.78 rows=185,851 width=4) (actual time=0.035..109.561 rows=185,994 loops=1)

  • Filter: (NOT reconciled)
  • Rows Removed by Filter: 6884
11. 0.007 0.026 ↑ 30.0 10 1

Hash (cost=13.00..13.00 rows=300 width=8) (actual time=0.026..0.026 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.019 0.019 ↑ 30.0 10 1

Seq Scan on credit_control_policy_level ccpl (cost=0.00..13.00 rows=300 width=8) (actual time=0.017..0.019 rows=10 loops=1)

13.          

SubPlan (forHash Left Join)

14. 367.400 5,694.700 ↑ 1.0 1 91,850

Aggregate (cost=17.65..17.66 rows=1 width=32) (actual time=0.062..0.062 rows=1 loops=91,850)

15. 668.430 5,327.300 ↓ 6.0 6 91,850

Nested Loop (cost=15.41..17.65 rows=1 width=3) (actual time=0.032..0.058 rows=6 loops=91,850)

16. 734.800 2,479.950 ↓ 6.0 6 91,850

HashAggregate (cost=14.99..15.00 rows=1 width=4) (actual time=0.025..0.027 rows=6 loops=91,850)

  • Group Key: ccl2.move_line_id
17. 1,745.150 1,745.150 ↓ 13.0 13 91,850

Index Scan using credit_control_line_commercial_partner_id_index on credit_control_line ccl2 (cost=0.42..14.99 rows=1 width=4) (actual time=0.005..0.019 rows=13 loops=91,850)

  • Index Cond: (commercial_partner_id = partner.id)
  • Filter: ((((ccl.currency_id IS NULL) AND (currency_id IS NULL)) OR (currency_id = ccl.currency_id)) AND (policy_id = ccl.policy_id))
18. 2,178.920 2,178.920 ↑ 1.0 1 544,730

Index Scan using account_move_line_pkey on account_move_line aml_1 (cost=0.42..2.64 rows=1 width=7) (actual time=0.004..0.004 rows=1 loops=544,730)

  • Index Cond: (id = ccl2.move_line_id)
  • Filter: (NOT reconciled)
  • Rows Removed by Filter: 0