explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PFef : Optimization for: plan #IGa4

Settings

Optimization path:

Optimization(s) for this plan:

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

Hash Join (cost=54,260.16..10,095,218,138.52 rows=145,378 width=68) (actual rows= loops=)

  • Hash Cond: ((ecr.code_affaire)::text = (account_analytic_account.code)::text)
  • Functions: 126
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
2. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on ecritures_compta_maj ecr (cost=3,271.95..40,892.90 rows=145,378 width=36) (actual rows= loops=)

  • Recheck Cond: ((journal)::text = ANY ('{VEN,VEF,VEX}'::text[]))
3. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on ecritures_compta_maj_journal_idx (cost=0.00..3,235.61 rows=145,378 width=0) (actual rows= loops=)

  • Index Cond: ((journal)::text = ANY ('{VEN,VEF,VEX}'::text[]))
4. 0.000 0.000 ↓ 0.0

Hash (cost=47,009.32..47,009.32 rows=318,311 width=9) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Unique (cost=0.42..43,826.21 rows=318,311 width=9) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Index Only Scan using account_analytic_account_code_idx on account_analytic_account (cost=0.42..43,030.43 rows=318,311 width=9) (actual rows= loops=)

7.          

SubPlan (for Hash Join)

8. 0.000 0.000 ↓ 0.0

Limit (cost=9.31..69,381.23 rows=1 width=4) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.31..69,381.23 rows=1 width=4) (actual rows= loops=)

  • Join Filter: (cbld.budget_detail_id = abd.id)
10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.31..69,345.80 rows=1 width=4) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=8.88..69,345.24 rows=1 width=4) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..69,341.89 rows=6 width=8) (actual rows= loops=)

  • Hash Cond: (ail.account_analytic_id = aa.id)
13. 0.000 0.000 ↓ 0.0

Seq Scan on account_invoice_line ail (cost=0.00..64,299.32 rows=1,917,732 width=12) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

15. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account aa (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)
16. 0.000 0.000 ↓ 0.0

Index Scan using account_invoice_pkey on account_invoice iv (cost=0.42..0.56 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (id = ail.invoice_id)
  • Filter: (ltrim(rtrim((number)::text)) = CASE WHEN ("substring"(ltrim(rtrim((ecr.origine)::text)), 1, 2) = 'FA'::text) THEN "substring"(ltrim(rtrim((ecr.origine)::text)), 1, 10) WHEN ("substring"(ltrim(rtrim((ecr.origine)::text)), 1, 4) = '0000'::text) THEN "substring"(ltrim(rtrim((ecr.origine)::text)), 1, 10) ELSE ltrim(rtrim((ecr.origine)::text)) END)
17. 0.000 0.000 ↓ 0.0

Index Scan using crossovered_budget_lines_detail_pkey on crossovered_budget_lines_detail cbld (cost=0.43..0.57 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = ail.budget_detail_id)
18. 0.000 0.000 ↓ 0.0

Seq Scan on affair_budget_detail abd (cost=0.00..21.30 rows=1,130 width=8) (actual rows= loops=)

19. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..9.87 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (y.id = x.sales_type_id)
20. 0.000 0.000 ↓ 0.0

Seq Scan on cesbron_selling_type y (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account x (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)
23. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..9.87 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (y_1.id = x_1.sales_type_id)
24. 0.000 0.000 ↓ 0.0

Seq Scan on cesbron_selling_type y_1 (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account x_1 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)
27. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..9.87 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (y_2.id = x_2.sales_type_id)
28. 0.000 0.000 ↓ 0.0

Seq Scan on cesbron_selling_type y_2 (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

29. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

30. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account x_2 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)
31. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..9.87 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (y_3.id = x_3.sales_type_id)
32. 0.000 0.000 ↓ 0.0

Seq Scan on cesbron_selling_type y_3 (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

33. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

34. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account x_3 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)
35. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..9.87 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (y_4.id = x_4.sales_type_id)
36. 0.000 0.000 ↓ 0.0

Seq Scan on cesbron_selling_type y_4 (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

37. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

38. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account x_4 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)
39. 0.000 0.000 ↓ 0.0

Hash Join (cost=8.45..9.87 rows=1 width=4) (actual rows= loops=)

  • Hash Cond: (y_5.id = x_5.sales_type_id)
40. 0.000 0.000 ↓ 0.0

Seq Scan on cesbron_selling_type y_5 (cost=0.00..1.30 rows=30 width=8) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Hash (cost=8.44..8.44 rows=1 width=4) (actual rows= loops=)

42. 0.000 0.000 ↓ 0.0

Index Scan using account_analytic_account_code_idx on account_analytic_account x_5 (cost=0.42..8.44 rows=1 width=4) (actual rows= loops=)

  • Index Cond: ((code)::text = (ecr.code_affaire)::text)JIT: