explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NxBr

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Subquery Scan on credit_control_analysis (cost=1,620,348.36..1,622,339.72 rows=443 width=72) (actual rows= loops=)

  • Filter: (credit_control_analysis.id = 11068)
2. 0.000 0.000 ↓ 0.0

Unique (cost=1,620,348.36..1,621,233.41 rows=88,505 width=76) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

Sort (cost=1,620,348.36..1,620,569.62 rows=88,505 width=76) (actual rows= loops=)

  • Sort Key: partner.id, ccl.policy_id, ccl.currency_id, ccpl.level DESC, ccl.id
4. 0.000 0.000 ↓ 0.0

Hash Left Join (cost=11,565.25..1,610,771.94 rows=88,505 width=76) (actual rows= loops=)

  • Hash Cond: (ccl.policy_level_id = ccpl.id)
5. 0.000 0.000 ↓ 0.0

Hash Join (cost=11,548.50..46,325.00 rows=88,505 width=36) (actual rows= loops=)

  • Hash Cond: (ccl.move_line_id = aml.id)
6. 0.000 0.000 ↓ 0.0

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

  • Merge Cond: (ccl.commercial_partner_id = partner.id)
7. 0.000 0.000 ↓ 0.0

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 rows= loops=)

8. 0.000 0.000 ↓ 0.0

Index Scan using res_partner_pkey on res_partner partner (cost=0.42..30,319.23 rows=237,673 width=20) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

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

10. 0.000 0.000 ↓ 0.0

Seq Scan on account_move_line aml (cost=0.00..8,392.78 rows=185,851 width=4) (actual rows= loops=)

  • Filter: (NOT reconciled)
11. 0.000 0.000 ↓ 0.0

Hash (cost=13.00..13.00 rows=300 width=8) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Seq Scan on credit_control_policy_level ccpl (cost=0.00..13.00 rows=300 width=8) (actual rows= loops=)

13.          

SubPlan (for Hash Left Join)

14. 0.000 0.000 ↓ 0.0

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

15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=15.41..17.65 rows=1 width=3) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

HashAggregate (cost=14.99..15.00 rows=1 width=4) (actual rows= loops=)

  • Group Key: ccl2.move_line_id
17. 0.000 0.000 ↓ 0.0

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 rows= loops=)

  • 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. 0.000 0.000 ↓ 0.0

Index Scan using account_move_line_pkey on account_move_line aml_1 (cost=0.42..2.64 rows=1 width=7) (actual rows= loops=)

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