explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l8ZQ

Settings
# exclusive inclusive rows x rows loops node
1. 174.803 10,905.907 ↓ 120.7 32,600 1

Nested Loop Left Join (cost=97.92..18,291.15 rows=270 width=49) (actual time=0.555..10,905.907 rows=32,600 loops=1)

  • Join Filter: (e.default_responsibles IS NOT TRUE)
  • Rows Removed by Join Filter: 32,600
2. 119.866 8,872.904 ↓ 120.7 32,600 1

Nested Loop Left Join (cost=63.36..8,950.93 rows=270 width=27) (actual time=0.471..8,872.904 rows=32,600 loops=1)

  • Join Filter: e.default_responsibles
3. 78.660 211.838 ↓ 120.7 32,600 1

Nested Loop (cost=30.96..194.86 rows=270 width=26) (actual time=0.133..211.838 rows=32,600 loops=1)

4. 21.170 67.978 ↓ 120.7 6,520 1

Nested Loop (cost=30.67..157.71 rows=54 width=16) (actual time=0.121..67.978 rows=6,520 loops=1)

5. 12.474 20.708 ↓ 120.8 6,525 1

Nested Loop (cost=30.40..139.26 rows=54 width=16) (actual time=0.107..20.708 rows=6,525 loops=1)

6. 0.024 0.024 ↓ 5.0 5 1

Seq Scan on entity_units (cost=0.00..11.50 rows=1 width=8) (actual time=0.017..0.024 rows=5 loops=1)

  • Filter: (entity_id = 9)
7. 7.815 8.210 ↑ 1.0 1,305 5

Bitmap Heap Scan on entity_unit_variables entityunitvariables (cost=30.40..114.71 rows=1,305 width=12) (actual time=0.089..1.642 rows=1,305 loops=5)

  • Recheck Cond: (entity_unit_id = entity_units.id)
  • Heap Blocks: exact=72
8. 0.395 0.395 ↑ 1.0 1,305 5

Bitmap Index Scan on entity_unit_variables_entity_unit_id_variable_id_key (cost=0.00..30.07 rows=1,305 width=0) (actual time=0.079..0.079 rows=1,305 loops=5)

  • Index Cond: (entity_unit_id = entity_units.id)
9. 26.100 26.100 ↑ 1.0 1 6,525

Index Scan using idx_variables_id on variables (cost=0.28..0.34 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=6,525)

  • Index Cond: (id = entityunitvariables.variable_id)
  • Filter: (status_id <> 4)
  • Rows Removed by Filter: 0
10. 65.200 65.200 ↑ 1.0 5 6,520

Index Scan using idx_entity_unit_variable_entity_variable_dimensions on entity_unit_variable_dimensions e (cost=0.29..0.64 rows=5 width=14) (actual time=0.004..0.010 rows=5 loops=6,520)

  • Index Cond: (entity_unit_variable_id = entityunitvariables.id)
11. 130.400 8,541.200 ↑ 1.0 1 32,600

Aggregate (cost=32.40..32.41 rows=1 width=1) (actual time=0.262..0.262 rows=1 loops=32,600)

12. 228.200 8,410.800 ↑ 1.0 1 32,600

Result (cost=1.11..32.39 rows=1 width=0) (actual time=0.177..0.258 rows=1 loops=32,600)

  • One-Time Filter: e.active
13. 195.600 8,182.600 ↑ 1.0 1 32,600

Nested Loop (cost=1.11..32.39 rows=1 width=0) (actual time=0.171..0.251 rows=1 loops=32,600)

  • Join Filter: (u.id = COALESCE(ledfr.user_id, luug.user_id))
  • Rows Removed by Join Filter: 1
14. 163.000 163.000 ↑ 1.0 1 32,600

Seq Scan on users u (cost=0.00..1.07 rows=1 width=4) (actual time=0.003..0.005 rows=1 loops=32,600)

  • Filter: ((external_id)::text = '79f30646-d7b1-11e8-8dbb-f2801f1b9fd1'::text)
  • Rows Removed by Filter: 5
15. 1,010.600 7,824.000 ↑ 1.0 2 32,600

Nested Loop Left Join (cost=1.11..31.29 rows=2 width=8) (actual time=0.144..0.240 rows=2 loops=32,600)

  • Join Filter: (luug.user_group_id = ug.id)
  • Rows Removed by Join Filter: 25
16. 163.000 6,031.000 ↑ 1.0 1 32,600

Nested Loop Left Join (cost=1.11..29.69 rows=1 width=8) (actual time=0.120..0.185 rows=1 loops=32,600)

17. 163.000 5,770.200 ↑ 1.0 1 32,600

Nested Loop Left Join (cost=0.98..29.52 rows=1 width=8) (actual time=0.114..0.177 rows=1 loops=32,600)

18. 293.400 5,444.200 ↑ 1.0 1 32,600

Nested Loop (cost=0.70..29.18 rows=1 width=4) (actual time=0.107..0.167 rows=1 loops=32,600)

  • Join Filter: (v.type_id = vt.id)
19. 163.000 5,085.600 ↑ 1.0 1 32,600

Nested Loop (cost=0.70..28.14 rows=1 width=8) (actual time=0.098..0.156 rows=1 loops=32,600)

20. 1,988.600 4,792.200 ↑ 1.0 1 32,600

Nested Loop (cost=0.56..19.97 rows=1 width=12) (actual time=0.092..0.147 rows=1 loops=32,600)

  • Join Filter: (v.family_id = edf.family_id)
  • Rows Removed by Join Filter: 66
21. 293.400 652.000 ↑ 1.0 1 32,600

Nested Loop (cost=0.28..9.68 rows=1 width=16) (actual time=0.014..0.020 rows=1 loops=32,600)

22. 195.600 195.600 ↑ 1.0 1 32,600

Seq Scan on entity_unit_dimensions ed (cost=0.00..1.38 rows=1 width=8) (actual time=0.003..0.006 rows=1 loops=32,600)

  • Filter: ((dimension_id = e.dimension_id) AND (entity_unit_id = entityunitvariables.entity_unit_id))
  • Rows Removed by Filter: 24
23. 163.000 163.000 ↑ 1.0 1 32,600

Index Scan using idx_variables_id on variables v (cost=0.28..8.30 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=32,600)

  • Index Cond: (id = entityunitvariables.variable_id)
  • Filter: (status_id <> 4)
24. 2,151.600 2,151.600 ↑ 1.0 67 32,600

Index Scan using idx_entity_unit_dimension_families_entity_unit_dimension_id on entity_unit_dimension_families edf (cost=0.28..9.45 rows=67 width=12) (actual time=0.005..0.066 rows=67 loops=32,600)

  • Index Cond: (entity_unit_dimension_id = ed.id)
25. 130.400 130.400 ↑ 1.0 1 32,600

Index Scan using "EntityUnit_pkey" on entity_units eu (cost=0.14..8.16 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=32,600)

  • Index Cond: (id = entityunitvariables.entity_unit_id)
  • Filter: (entity_id = 9)
26. 65.200 65.200 ↑ 1.0 1 32,600

Seq Scan on variable_types vt (cost=0.00..1.02 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=32,600)

  • Filter: ((system_slug)::text = 'base'::text)
  • Rows Removed by Filter: 1
27. 163.000 163.000 ↑ 1.0 1 32,600

Index Scan using idx_entity_unit_dimension_family_responsibles_entity_dimension_ on lnk_entity_unit_dimension_family_responsibles ledfr (cost=0.28..0.33 rows=1 width=12) (actual time=0.003..0.005 rows=1 loops=32,600)

  • Index Cond: (entity_unit_dimension_family_id = edf.id)
28. 97.800 97.800 ↑ 1.0 1 32,600

Index Scan using user_groups_pkey on user_groups ug (cost=0.14..0.16 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=32,600)

  • Index Cond: (id = ledfr.user_group_id)
  • Filter: (active IS NOT FALSE)
29. 782.400 782.400 ↑ 1.0 27 32,600

Seq Scan on lnk_user_user_groups luug (cost=0.00..1.27 rows=27 width=8) (actual time=0.003..0.024 rows=27 loops=32,600)

30. 65.200 1,858.200 ↑ 1.0 1 32,600

Aggregate (cost=34.56..34.57 rows=1 width=1) (actual time=0.057..0.057 rows=1 loops=32,600)

31. 97.800 1,793.000 ↓ 0.0 0 32,600

Result (cost=7.79..34.56 rows=1 width=0) (actual time=0.055..0.055 rows=0 loops=32,600)

  • One-Time Filter: e.active
32. 32.600 1,695.200 ↓ 0.0 0 32,600

Hash Left Join (cost=7.79..34.56 rows=1 width=0) (actual time=0.052..0.052 rows=0 loops=32,600)

  • Hash Cond: (ug_1.id = luug_1.user_group_id)
  • Filter: (u_1.id = COALESCE(evdr.user_id, luug_1.user_id))
33. 130.400 1,662.600 ↓ 0.0 0 32,600

Nested Loop (cost=6.18..32.89 rows=2 width=12) (actual time=0.051..0.051 rows=0 loops=32,600)

34. 163.000 1,206.200 ↑ 1.0 1 32,600

Nested Loop (cost=0.69..17.88 rows=1 width=4) (actual time=0.028..0.037 rows=1 loops=32,600)

35. 163.000 945.400 ↑ 1.0 1 32,600

Nested Loop (cost=0.56..17.69 rows=1 width=8) (actual time=0.022..0.029 rows=1 loops=32,600)

36. 326.000 652.000 ↑ 1.0 1 32,600

Nested Loop (cost=0.28..9.38 rows=1 width=8) (actual time=0.015..0.020 rows=1 loops=32,600)

37. 163.000 163.000 ↑ 1.0 1 32,600

Index Scan using variable_units_pkey on entity_unit_variables ev (cost=0.28..8.30 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=32,600)

  • Index Cond: (id = e.entity_unit_variable_id)
38. 163.000 163.000 ↑ 1.0 1 32,600

Seq Scan on users u_1 (cost=0.00..1.07 rows=1 width=4) (actual time=0.003..0.005 rows=1 loops=32,600)

  • Filter: ((external_id)::text = '79f30646-d7b1-11e8-8dbb-f2801f1b9fd1'::text)
  • Rows Removed by Filter: 5
39. 130.400 130.400 ↑ 1.0 1 32,600

Index Scan using idx_variables_id on variables variables_1 (cost=0.28..8.30 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=32,600)

  • Index Cond: (id = ev.variable_id)
  • Filter: (status_id <> 4)
40. 97.800 97.800 ↑ 1.0 1 32,600

Index Scan using variable_types_pkey on variable_types vt_1 (cost=0.13..0.16 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=32,600)

  • Index Cond: (id = variables_1.type_id)
  • Filter: ((system_slug)::text = 'base'::text)
41. 195.600 326.000 ↓ 0.0 0 32,600

Hash Left Join (cost=5.49..14.98 rows=3 width=8) (actual time=0.010..0.010 rows=0 loops=32,600)

  • Hash Cond: (evdr.user_group_id = ug_1.id)
  • Filter: (ug_1.active IS NOT FALSE)
42. 65.200 130.400 ↓ 0.0 0 32,600

Bitmap Heap Scan on entity_unit_variable_dimension_responsibles evdr (cost=4.20..13.67 rows=6 width=8) (actual time=0.004..0.004 rows=0 loops=32,600)

  • Recheck Cond: (e.id = entity_unit_variable_dimension_id)
43. 65.200 65.200 ↓ 0.0 0 32,600

Bitmap Index Scan on idx_entity_unit_variable_dimension_responsibles_entity_variable (cost=0.00..4.20 rows=6 width=0) (actual time=0.002..0.002 rows=0 loops=32,600)

  • Index Cond: (entity_unit_variable_dimension_id = e.id)
44. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.13..1.13 rows=13 width=5) (never executed)

45. 0.000 0.000 ↓ 0.0 0

Seq Scan on user_groups ug_1 (cost=0.00..1.13 rows=13 width=5) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.27..1.27 rows=27 width=8) (never executed)

47. 0.000 0.000 ↓ 0.0 0

Seq Scan on lnk_user_user_groups luug_1 (cost=0.00..1.27 rows=27 width=8) (never executed)