explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Bvno

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 1,296.279 ↑ 1.0 80 1

Limit (cost=56,425.81..57,841.21 rows=80 width=72) (actual time=1,289.931..1,296.279 rows=80 loops=1)

2. 0.028 1,296.240 ↑ 1,106.3 80 1

Subquery Scan on credit_control_analysis (cost=56,425.81..1,622,294.21 rows=88,505 width=72) (actual time=1,289.930..1,296.240 rows=80 loops=1)

3. 0.149 1,296.212 ↑ 1,106.3 80 1

Result (cost=56,425.81..1,621,409.16 rows=88,505 width=76) (actual time=1,289.929..1,296.212 rows=80 loops=1)

4. 0.234 1,290.303 ↑ 1,106.3 80 1

Unique (cost=56,425.81..57,310.86 rows=88,505 width=44) (actual time=1,289.776..1,290.303 rows=80 loops=1)

5. 209.516 1,290.069 ↑ 93.9 943 1

Sort (cost=56,425.81..56,647.08 rows=88,505 width=44) (actual time=1,289.774..1,290.069 rows=943 loops=1)

  • Sort Key: partner.id, ccl.policy_id, ccl.currency_id, ccpl.level DESC, ccl.id
  • Sort Method: external sort Disk: 4488kB
6. 50.560 1,080.553 ↓ 1.0 91,850 1

Hash Left Join (cost=11,565.25..47,558.69 rows=88,505 width=44) (actual time=154.139..1,080.553 rows=91,850 loops=1)

  • Hash Cond: (ccl.policy_level_id = ccpl.id)
7. 109.096 1,029.974 ↓ 1.0 91,850 1

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

  • Hash Cond: (ccl.move_line_id = aml.id)
8. 84.909 768.866 ↑ 1.0 91,851 1

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

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

10. 554.566 554.566 ↓ 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.007..554.566 rows=272,445 loops=1)

11. 54.830 152.012 ↓ 1.0 185,994 1

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

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

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
14. 0.012 0.012 ↑ 30.0 10 1

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

15.          

SubPlan (for Result)

16. 0.240 5.760 ↑ 1.0 1 80

Aggregate (cost=17.65..17.66 rows=1 width=32) (actual time=0.072..0.072 rows=1 loops=80)

17. 0.333 5.520 ↓ 5.0 5 80

Nested Loop (cost=15.41..17.65 rows=1 width=3) (actual time=0.036..0.069 rows=5 loops=80)

18. 0.560 2.240 ↓ 5.0 5 80

HashAggregate (cost=14.99..15.00 rows=1 width=4) (actual time=0.027..0.028 rows=5 loops=80)

  • Group Key: ccl2.move_line_id
19. 1.680 1.680 ↓ 12.0 12 80

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.006..0.021 rows=12 loops=80)

  • 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))
20. 2.947 2.947 ↑ 1.0 1 421

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.006..0.007 rows=1 loops=421)

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