explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YBMX

Settings
# exclusive inclusive rows x rows loops node
1. 3.543 1,742.161 ↓ 1.2 80 1

Subquery Scan on credit_control_analysis (cost=772,910.51..774,990.56 rows=68 width=99) (actual time=1,722.318..1,742.161 rows=80 loops=1)

  • Rows Removed by Filter: 7581
2. 6.137 1,738.618 ↑ 2.2 7,661 1

Unique (cost=772,910.51..773,080.31 rows=16,980 width=103) (actual time=1,722.263..1,738.618 rows=7,661 loops=1)

3. 81.077 1,732.481 ↓ 3.6 61,861 1

Sort (cost=772,910.51..772,952.96 rows=16,980 width=103) (actual time=1,722.263..1,732.481 rows=61,861 loops=1)

  • Sort Key: partner.id, ccl.policy_id, ccl.currency_id, ccpl.level DESC, ccl.id
  • Sort Method: external merge Disk: 3648kB
4. 1,479.343 1,651.404 ↓ 3.6 61,861 1

Gather (cost=4,674.12..771,717.54 rows=16,980 width=103) (actual time=34.267..1,651.404 rows=61,861 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 79.656 172.037 ↓ 2.9 20,620 3

Nested Loop Left Join (cost=3,674.12..29,007.65 rows=7,075 width=71) (actual time=33.056..172.037 rows=20,620 loops=3)

6. 10.638 92.378 ↓ 2.9 20,620 3

Hash Join (cost=3,673.70..11,221.18 rows=7,075 width=28) (actual time=33.013..92.378 rows=20,620 loops=3)

  • Hash Cond: (ccpl.policy_id = ccp.id)
  • Join Filter: (aml.amount_residual > (ccp.ignore_overdue)::numeric)
7. 6.173 81.718 ↑ 1.0 20,620 3

Hash Join (cost=3,645.48..11,137.09 rows=21,225 width=35) (actual time=32.910..81.718 rows=20,620 loops=3)

  • Hash Cond: (ccl.policy_level_id = ccpl.id)
8. 24.303 75.530 ↑ 1.0 20,620 3

Hash Join (cost=3,629.41..11,064.42 rows=21,225 width=27) (actual time=32.881..75.530 rows=20,620 loops=3)

  • Hash Cond: (aml.id = ccl.move_line_id)
9. 18.688 18.688 ↑ 1.3 61,013 3

Parallel Seq Scan on account_move_line aml (cost=0.00..6,173.34 rows=76,322 width=7) (actual time=0.009..18.688 rows=61,013 loops=3)

  • Filter: (NOT reconciled)
  • Rows Removed by Filter: 2295
10. 14.787 32.539 ↓ 1.2 61,861 3

Hash (cost=2,969.18..2,969.18 rows=52,818 width=28) (actual time=32.539..32.539 rows=61,861 loops=3)

  • Buckets: 65536 Batches: 1 Memory Usage: 3896kB
11. 17.752 17.752 ↓ 1.2 61,861 3

Seq Scan on credit_control_line ccl (cost=0.00..2,969.18 rows=52,818 width=28) (actual time=0.015..17.752 rows=61,861 loops=3)

12. 0.005 0.015 ↑ 38.6 7 3

Hash (cost=12.70..12.70 rows=270 width=12) (actual time=0.015..0.015 rows=7 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.010 0.010 ↑ 38.6 7 3

Seq Scan on credit_control_policy_level ccpl (cost=0.00..12.70 rows=270 width=12) (actual time=0.008..0.010 rows=7 loops=3)

14. 0.005 0.022 ↑ 270.0 3 3

Hash (cost=18.10..18.10 rows=810 width=8) (actual time=0.022..0.022 rows=3 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.017 0.017 ↑ 270.0 3 3

Seq Scan on credit_control_policy ccp (cost=0.00..18.10 rows=810 width=8) (actual time=0.016..0.017 rows=3 loops=3)

16. 0.003 0.003 ↑ 1.0 1 61,861

Index Scan using res_partner_pkey on res_partner partner (cost=0.42..2.51 rows=1 width=47) (actual time=0.003..0.003 rows=1 loops=61,861)

  • Index Cond: (id = ccl.commercial_partner_id)
17.          

SubPlan (forGather)

18. 0.002 0.024 ↑ 1.0 1 61,861

Aggregate (cost=43.57..43.58 rows=1 width=32) (actual time=0.024..0.024 rows=1 loops=61,861)

19. 0.009 0.022 ↓ 6.0 6 61,861

Nested Loop (cost=35.54..43.57 rows=1 width=3) (actual time=0.013..0.022 rows=6 loops=61,861)

20. 0.004 0.011 ↓ 6.0 6 61,861

HashAggregate (cost=35.12..35.13 rows=1 width=4) (actual time=0.010..0.011 rows=6 loops=61,861)

  • Group Key: ccl2.move_line_id
21. 0.005 0.007 ↓ 9.0 9 61,861

Bitmap Heap Scan on credit_control_line ccl2 (cost=4.35..35.12 rows=1 width=4) (actual time=0.004..0.007 rows=9 loops=61,861)

  • 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))
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=377789
22. 0.002 0.002 ↓ 1.1 9 61,861

Bitmap Index Scan on credit_control_line_commercial_partner_id_index (cost=0.00..4.35 rows=8 width=0) (actual time=0.002..0.002 rows=9 loops=61,861)

  • Index Cond: (commercial_partner_id = partner.id)
23. 0.002 0.002 ↑ 1.0 1 371,283

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=371,283)

  • Index Cond: (id = ccl2.move_line_id)
  • Filter: (NOT reconciled)