explain.depesz.com

PostgreSQL's explain analyze made readable

Result: v2kg

Settings
# exclusive inclusive rows x rows loops node
1. 2.915 5,491.033 ↑ 635.3 80 1

Subquery Scan on credit_control_analysis (cost=10,390,102.07..10,405,349.03 rows=50,823 width=72) (actual time=5,459.994..5,491.033 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.413 5,488.118 ↑ 16.7 7,622 1

Unique (cost=10,390,102.07..10,391,372.65 rows=127,058 width=76) (actual time=5,457.459..5,488.118 rows=7,622 loops=1)

3. 189.137 5,476.705 ↓ 1.0 131,670 1

Sort (cost=10,390,102.07..10,390,419.71 rows=127,058 width=76) (actual time=5,457.458..5,476.705 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: 7240kB
4. 144.901 5,287.568 ↓ 1.0 131,670 1

Hash Left Join (cost=29,369.97..10,373,681.64 rows=127,058 width=76) (actual time=249.817..5,287.568 rows=131,670 loops=1)

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

Hash Left Join (cost=10,520.33..18,203.57 rows=127,058 width=24) (actual time=93.086..248.737 rows=131,670 loops=1)

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

Hash Join (cost=10,519.10..17,727.46 rows=127,058 width=20) (actual time=93.048..220.074 rows=131,670 loops=1)

  • Hash Cond: (ccl.move_line_id = aml.id)
7. 38.511 38.511 ↑ 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.114..38.511 rows=131,671 loops=1)

8. 32.226 92.159 ↑ 1.0 187,345 1

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

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

Seq Scan on account_move_line aml (cost=0.00..7,443.29 rows=187,425 width=4) (actual time=0.022..59.933 rows=187,345 loops=1)

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

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

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

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

12. 43.725 153.810 ↑ 1.0 237,673 1

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

  • Buckets: 65536 Batches: 4 Memory Usage: 3244kB
13. 110.085 110.085 ↑ 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.085 rows=237,673 loops=1)

14.          

SubPlan (for Hash Left Join)

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

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

16. 17.634 4,476.780 ↓ 6.0 6 131,670

Nested Loop (cost=73.29..81.31 rows=1 width=3) (actual time=0.024..0.034 rows=6 loops=131,670)

17. 658.350 2,896.740 ↓ 6.0 6 131,670

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

  • Group Key: ccl2.move_line_id
18. 1,843.380 2,238.390 ↓ 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.017 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