explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oHvk

Settings
# exclusive inclusive rows x rows loops node
1. 2.405 5,555.420 ↑ 635.5 80 1

Subquery Scan on credit_control_analysis (cost=10,397,992.21..10,413,242.89 rows=50,836 width=72) (actual time=5,523.875..5,555.420 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: 7542
2. 11.121 5,553.015 ↑ 16.7 7,622 1

Unique (cost=10,397,992.21..10,399,263.10 rows=127,089 width=76) (actual time=5,521.520..5,553.015 rows=7,622 loops=1)

3. 181.646 5,541.894 ↓ 1.0 131,670 1

Sort (cost=10,397,992.21..10,398,309.93 rows=127,089 width=76) (actual time=5,521.519..5,541.894 rows=131,670 loops=1)

  • Sort Key: partner.id, ccl.policy_id, ccl.currency_id, ccpl.level DESC, ccl.id
  • Sort Method: external merge Disk: 7216kB
4. 214.187 5,360.248 ↓ 1.0 131,670 1

Hash Left Join (cost=29,370.53..10,381,568.94 rows=127,089 width=76) (actual time=252.785..5,360.248 rows=131,670 loops=1)

  • Hash Cond: (ccl.commercial_partner_id = partner.id)
5. 29.537 251.781 ↓ 1.0 131,670 1

Hash Left Join (cost=10,520.89..20,895.73 rows=127,089 width=24) (actual time=98.080..251.781 rows=131,670 loops=1)

  • Hash Cond: (ccl.policy_level_id = ccpl.id)
6. 95.760 222.222 ↓ 1.0 131,670 1

Hash Join (cost=10,519.67..19,147.03 rows=127,089 width=20) (actual time=98.045..222.222 rows=131,670 loops=1)

  • Hash Cond: (ccl.move_line_id = aml.id)
7. 29.594 29.594 ↑ 1.0 131,671 1

Seq Scan on credit_control_line ccl (cost=0.00..4,585.71 rows=131,671 width=24) (actual time=0.023..29.594 rows=131,671 loops=1)

8. 34.857 96.868 ↑ 1.0 187,345 1

Hash (cost=7,443.29..7,443.29 rows=187,470 width=4) (actual time=96.868..96.868 rows=187,345 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 2681kB
9. 62.011 62.011 ↑ 1.0 187,345 1

Seq Scan on account_move_line aml (cost=0.00..7,443.29 rows=187,470 width=4) (actual time=0.062..62.011 rows=187,345 loops=1)

  • Filter: (NOT reconciled)
  • Rows Removed by Filter: 6884
10. 0.003 0.022 ↑ 1.0 10 1

Hash (cost=1.10..1.10 rows=10 width=8) (actual time=0.022..0.022 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.019 0.019 ↑ 1.0 10 1

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

12. 43.315 154.160 ↑ 1.0 237,673 1

Hash (cost=14,485.73..14,485.73 rows=237,673 width=20) (actual time=154.160..154.160 rows=237,673 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 3244kB
13. 110.845 110.845 ↑ 1.0 237,673 1

Seq Scan on res_partner partner (cost=0.00..14,485.73 rows=237,673 width=20) (actual time=0.006..110.845 rows=237,673 loops=1)

14.          

SubPlan (for Hash Left Join)

15. 131.670 4,740.120 ↑ 1.0 1 131,670

Aggregate (cost=81.33..81.34 rows=1 width=32) (actual time=0.036..0.036 rows=1 loops=131,670)

16. 280.974 4,608.450 ↓ 6.0 6 131,670

Nested Loop (cost=73.29..81.32 rows=1 width=3) (actual time=0.023..0.035 rows=6 loops=131,670)

17. 790.020 2,765.070 ↓ 6.0 6 131,670

HashAggregate (cost=72.87..72.88 rows=1 width=4) (actual time=0.021..0.021 rows=6 loops=131,670)

  • Group Key: ccl2.move_line_id
18. 1,580.040 1,975.050 ↓ 19.0 19 131,670

Bitmap Heap Scan on credit_control_line ccl2 (cost=4.56..72.86 rows=1 width=4) (actual time=0.005..0.015 rows=19 loops=131,670)

  • Recheck 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))
  • Heap Blocks: exact=1579914
19. 395.010 395.010 ↓ 1.1 19 131,670

Bitmap Index Scan on credit_control_line_commercial_partner_id_index (cost=0.00..4.55 rows=18 width=0) (actual time=0.003..0.003 rows=19 loops=131,670)

  • Index Cond: (commercial_partner_id = partner.id)
20. 1,562.406 1,562.406 ↑ 1.0 1 781,203

Index Scan using account_move_line_pkey on account_move_line aml_1 (cost=0.42..8.44 rows=1 width=7) (actual time=0.002..0.002 rows=1 loops=781,203)

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