explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Acj1

Settings
# exclusive inclusive rows x rows loops node
1. 2.495 6,470.676 ↑ 11.6 7,621 1

Subquery Scan on credit_control_analysis (cost=1,620,348.36..1,622,118.46 rows=88,505 width=72) (actual time=6,425.717..6,470.676 rows=7,621 loops=1)

2. 20.186 6,468.181 ↑ 11.6 7,621 1

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

3. 246.197 6,447.995 ↓ 1.0 91,850 1

Sort (cost=1,620,348.36..1,620,569.62 rows=88,505 width=76) (actual time=6,425.713..6,447.995 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. 150.664 6,201.798 ↓ 1.0 91,850 1

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

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

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

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

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

  • Merge Cond: (ccl.commercial_partner_id = partner.id)
7. 104.459 104.459 ↑ 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.006..104.459 rows=91,851 loops=1)

8. 532.035 532.035 ↓ 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.005..532.035 rows=272,445 loops=1)

9. 51.735 144.513 ↓ 1.0 185,994 1

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

  • Buckets: 131072 Batches: 2 Memory Usage: 4296kB
10. 92.778 92.778 ↓ 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.030..92.778 rows=185,994 loops=1)

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

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

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

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

13.          

SubPlan (for Hash Left Join)

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

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

15. 301.030 4,684.350 ↓ 6.0 6 91,850

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

16. 642.950 2,204.400 ↓ 6.0 6 91,850

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

  • Group Key: ccl2.move_line_id
17. 1,561.450 1,561.450 ↓ 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.004..0.017 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.003..0.004 rows=1 loops=544,730)

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