explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9Nn7

Settings
# exclusive inclusive rows x rows loops node
1. 132.293 9,554.371 ↓ 118.5 32,600 1

HashAggregate (cost=26,631.80..26,634.55 rows=275 width=49) (actual time=9,500.464..9,554.371 rows=32,600 loops=1)

  • Group Key: (concat(entityvariables.variable_id, entityvariables.entity_id, e.dimension_id, 0)), entityvariables.entity_id, (NULL::integer), entityvariables.variable_id, e.dimension_id, (CASE WHEN e.default_responsibles THEN (SubPlan 1) ELSE (SubPlan 2) END)
2. 56.283 9,422.078 ↓ 118.5 32,600 1

Append (cost=0.85..26,627.68 rows=275 width=49) (actual time=0.462..9,422.078 rows=32,600 loops=1)

3. 0.003 0.019 ↓ 0.0 0 1

Nested Loop (cost=0.85..522.53 rows=5 width=49) (actual time=0.018..0.019 rows=0 loops=1)

4. 0.002 0.016 ↓ 0.0 0 1

Nested Loop (cost=0.56..16.57 rows=1 width=12) (actual time=0.015..0.016 rows=0 loops=1)

5. 0.014 0.014 ↓ 0.0 0 1

Index Scan using entity_variables_entity_id_variable_id_key on entity_variables entityvariables (cost=0.29..8.26 rows=1 width=12) (actual time=0.013..0.014 rows=0 loops=1)

  • Index Cond: (entity_id = 9)
6. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_variables_id on variables (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (id = entityvariables.variable_id)
  • Filter: (status_id <> 4)
7. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_entity_variable_entity_variable_dimensions on entity_variable_dimensions e (cost=0.29..22.70 rows=5 width=14) (never executed)

  • Index Cond: (entity_variable_id = entityvariables.id)
8.          

SubPlan (for Nested Loop)

9. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=50.89..50.90 rows=1 width=1) (never executed)

10. 0.000 0.000 ↓ 0.0 0

Result (cost=5.86..50.89 rows=1 width=0) (never executed)

  • One-Time Filter: e.active
11. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.86..50.89 rows=1 width=0) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.73..49.68 rows=2 width=8) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.60..47.48 rows=1 width=8) (never executed)

14. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.46..47.32 rows=1 width=8) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.18..46.98 rows=1 width=4) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.04..43.14 rows=23 width=8) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.41..20.47 rows=1 width=4) (never executed)

  • Join Filter: (v.type_id = vt.id)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_variables_id on variables v (cost=0.28..8.30 rows=1 width=8) (never executed)

  • Index Cond: (id = entityvariables.variable_id)
  • Filter: (status_id <> 4)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using variable_types_pkey on variable_types vt (cost=0.13..12.16 rows=1 width=4) (never executed)

  • Filter: ((system_slug)::text = 'base'::text)
20. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on entity_dimension_families edf (cost=4.64..22.21 rows=46 width=12) (never executed)

  • Recheck Cond: (family_id = v.family_id)
21. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_entity_dimension_families_family_id (cost=0.00..4.63 rows=46 width=0) (never executed)

  • Index Cond: (family_id = v.family_id)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_entity_dimension_id on entity_dimensions ed (cost=0.14..0.17 rows=1 width=4) (never executed)

  • Index Cond: (id = edf.entity_dimension_id)
  • Filter: ((entity_id = 9) AND (dimension_id = e.dimension_id))
23. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_entity_dimension_family_responsibles_entity_dimension_famil on lnk_entity_dimension_family_responsibles ledfr (cost=0.28..0.33 rows=1 width=12) (never executed)

  • Index Cond: (entity_dimension_family_id = edf.id)
24. 0.000 0.000 ↓ 0.0 0

Index Scan using user_groups_pkey on user_groups ug (cost=0.14..0.16 rows=1 width=4) (never executed)

  • Index Cond: (id = ledfr.user_group_id)
  • Filter: (active IS NOT FALSE)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_lnk_user_user_groups_user_group_id on lnk_user_user_groups luug (cost=0.14..2.17 rows=2 width=8) (never executed)

  • Index Cond: (user_group_id = ug.id)
26. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users u (cost=0.13..0.59 rows=1 width=4) (never executed)

  • Index Cond: (id = COALESCE(ledfr.user_id, luug.user_id))
  • Filter: ((external_id)::text = '79f30646-d7b1-11e8-8dbb-f2801f1b9fd1'::text)
27. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=45.73..45.74 rows=1 width=1) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Result (cost=5.29..45.72 rows=1 width=0) (never executed)

  • One-Time Filter: e.active
29. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.29..45.72 rows=1 width=0) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.16..39.24 rows=3 width=8) (never executed)

31. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.02..37.01 rows=2 width=8) (never executed)

  • Filter: (ug_1.active IS NOT FALSE)
32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.89..30.53 rows=3 width=8) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.69..16.80 rows=1 width=0) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..16.61 rows=1 width=4) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Index Scan using entity_variable_pkey on entity_variables ev (cost=0.29..8.30 rows=1 width=4) (never executed)

  • Index Cond: (id = e.entity_variable_id)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_variables_id on variables variables_2 (cost=0.28..8.30 rows=1 width=8) (never executed)

  • Index Cond: (id = ev.variable_id)
  • Filter: (status_id <> 4)
37. 0.000 0.000 ↓ 0.0 0

Index Scan using variable_types_pkey on variable_types vt_1 (cost=0.13..0.16 rows=1 width=4) (never executed)

  • Index Cond: (id = variables_2.type_id)
  • Filter: ((system_slug)::text = 'base'::text)
38. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on entity_variable_dimension_responsibles evdr (cost=4.20..13.67 rows=6 width=8) (never executed)

  • Recheck Cond: (e.id = entity_variable_dimension_id)
39. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_entity_variable_dimension_responsibles_entity_variable_dime (cost=0.00..4.20 rows=6 width=0) (never executed)

  • Index Cond: (entity_variable_dimension_id = e.id)
40. 0.000 0.000 ↓ 0.0 0

Index Scan using user_groups_pkey on user_groups ug_1 (cost=0.14..2.15 rows=1 width=5) (never executed)

  • Index Cond: (id = evdr.user_group_id)
41. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_lnk_user_user_groups_user_group_id on lnk_user_user_groups luug_1 (cost=0.14..1.10 rows=2 width=8) (never executed)

  • Index Cond: (user_group_id = ug_1.id)
42. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users u_1 (cost=0.13..2.15 rows=1 width=4) (never executed)

  • Index Cond: (id = COALESCE(evdr.user_id, luug_1.user_id))
  • Filter: ((external_id)::text = '79f30646-d7b1-11e8-8dbb-f2801f1b9fd1'::text)
43. 194.475 9,365.776 ↓ 120.7 32,600 1

Nested Loop (cost=31.10..26,101.02 rows=270 width=49) (actual time=0.440..9,365.776 rows=32,600 loops=1)

44. 22.626 75.901 ↓ 120.7 6,520 1

Nested Loop (cost=30.82..196.45 rows=54 width=16) (actual time=0.101..75.901 rows=6,520 loops=1)

45. 19.070 27.175 ↓ 120.8 6,525 1

Nested Loop (cost=30.54..178.00 rows=54 width=16) (actual time=0.092..27.175 rows=6,525 loops=1)

46. 0.020 0.020 ↓ 5.0 5 1

Index Scan using "EntityUnit_pkey" on entity_units (cost=0.14..50.24 rows=1 width=8) (actual time=0.010..0.020 rows=5 loops=1)

  • Filter: (entity_id = 9)
47. 7.765 8.085 ↑ 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.071..1.617 rows=1,305 loops=5)

  • Recheck Cond: (entity_unit_id = entity_units.id)
  • Heap Blocks: exact=72
48. 0.320 0.320 ↑ 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.064..0.064 rows=1,305 loops=5)

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

Index Scan using idx_variables_id on variables variables_1 (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
50. 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_1 (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)
51.          

SubPlan (for Nested Loop)

52. 163.000 9,030.200 ↑ 1.0 1 32,600

Aggregate (cost=50.05..50.07 rows=1 width=1) (actual time=0.276..0.277 rows=1 loops=32,600)

53. 130.400 8,867.200 ↑ 1.0 1 32,600

Result (cost=5.85..50.05 rows=1 width=0) (actual time=0.161..0.272 rows=1 loops=32,600)

  • One-Time Filter: e_1.active
54. 225.800 8,736.800 ↑ 1.0 1 32,600

Nested Loop (cost=5.85..50.05 rows=1 width=0) (actual time=0.159..0.268 rows=1 loops=32,600)

55. 228.200 8,313.000 ↑ 1.0 2 32,600

Nested Loop Left Join (cost=5.72..48.84 rows=2 width=8) (actual time=0.144..0.255 rows=2 loops=32,600)

56. 130.400 7,921.800 ↑ 1.0 1 32,600

Nested Loop Left Join (cost=5.58..46.65 rows=1 width=8) (actual time=0.139..0.243 rows=1 loops=32,600)

57. 228.200 7,693.600 ↑ 1.0 1 32,600

Nested Loop Left Join (cost=5.45..46.48 rows=1 width=8) (actual time=0.133..0.236 rows=1 loops=32,600)

58. 195.600 7,335.000 ↑ 1.0 1 32,600

Nested Loop (cost=5.17..46.14 rows=1 width=4) (actual time=0.126..0.225 rows=1 loops=32,600)

59. 1,858.200 7,041.600 ↑ 1.0 1 32,600

Nested Loop (cost=5.03..37.97 rows=1 width=8) (actual time=0.120..0.216 rows=1 loops=32,600)

60. 1,825.600 3,553.400 ↓ 2.1 25 32,600

Nested Loop (cost=4.88..35.51 rows=12 width=8) (actual time=0.030..0.109 rows=25 loops=32,600)

61. 163.000 423.800 ↑ 1.0 1 32,600

Nested Loop (cost=0.41..20.47 rows=1 width=4) (actual time=0.010..0.013 rows=1 loops=32,600)

  • Join Filter: (v_1.type_id = vt_2.id)
62. 163.000 163.000 ↑ 1.0 1 32,600

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

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

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

  • Filter: ((system_slug)::text = 'base'::text)
  • Rows Removed by Filter: 1
64. 1,108.400 1,304.000 ↑ 1.0 25 32,600

Bitmap Heap Scan on entity_unit_dimension_families edf_1 (cost=4.47..14.78 rows=25 width=12) (actual time=0.011..0.040 rows=25 loops=32,600)

  • Recheck Cond: (family_id = v_1.family_id)
  • Heap Blocks: exact=299900
65. 195.600 195.600 ↑ 1.0 25 32,600

Bitmap Index Scan on idx_entity_unit_dimension_families_family_id (cost=0.00..4.46 rows=25 width=0) (actual time=0.006..0.006 rows=25 loops=32,600)

  • Index Cond: (family_id = v_1.family_id)
66. 1,630.000 1,630.000 ↓ 0.0 0 815,000

Index Scan using lnk_dimension_units_pkey on entity_unit_dimensions ed_1 (cost=0.15..0.20 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=815,000)

  • Index Cond: (id = edf_1.entity_unit_dimension_id)
  • Filter: ((dimension_id = e_1.dimension_id) AND (entity_unit_id = entityunitvariables.entity_unit_id))
  • Rows Removed by Filter: 1
67. 97.800 97.800 ↑ 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.002..0.003 rows=1 loops=32,600)

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

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

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

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

  • Index Cond: (id = ledfr_1.user_group_id)
  • Filter: (active IS NOT FALSE)
70. 163.000 163.000 ↑ 1.0 2 32,600

Index Scan using idx_lnk_user_user_groups_user_group_id on lnk_user_user_groups luug_2 (cost=0.14..2.17 rows=2 width=8) (actual time=0.002..0.005 rows=2 loops=32,600)

  • Index Cond: (user_group_id = ug_2.id)
71. 198.000 198.000 ↓ 0.0 0 66,000

Index Scan using users_pkey on users u_2 (cost=0.13..0.59 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=66,000)

  • Index Cond: (id = COALESCE(ledfr_1.user_id, luug_2.user_id))
  • Filter: ((external_id)::text = '79f30646-d7b1-11e8-8dbb-f2801f1b9fd1'::text)
  • Rows Removed by Filter: 1
72. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=45.72..45.74 rows=1 width=1) (never executed)

73. 0.000 0.000 ↓ 0.0 0

Result (cost=5.29..45.72 rows=1 width=0) (never executed)

  • One-Time Filter: e_1.active
74. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.29..45.72 rows=1 width=0) (never executed)

75. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.16..39.24 rows=3 width=8) (never executed)

76. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=5.02..37.01 rows=2 width=8) (never executed)

  • Filter: (ug_3.active IS NOT FALSE)
77. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.89..30.52 rows=3 width=8) (never executed)

78. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.69..16.80 rows=1 width=0) (never executed)

79. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..16.61 rows=1 width=4) (never executed)

80. 0.000 0.000 ↓ 0.0 0

Index Scan using variable_units_pkey on entity_unit_variables ev_1 (cost=0.28..8.30 rows=1 width=4) (never executed)

  • Index Cond: (id = e_1.entity_unit_variable_id)
81. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_variables_id on variables variables_3 (cost=0.28..8.30 rows=1 width=8) (never executed)

  • Index Cond: (id = ev_1.variable_id)
  • Filter: (status_id <> 4)
82. 0.000 0.000 ↓ 0.0 0

Index Scan using variable_types_pkey on variable_types vt_3 (cost=0.13..0.16 rows=1 width=4) (never executed)

  • Index Cond: (id = variables_3.type_id)
  • Filter: ((system_slug)::text = 'base'::text)
83. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on entity_unit_variable_dimension_responsibles evdr_1 (cost=4.20..13.67 rows=6 width=8) (never executed)

  • Recheck Cond: (e_1.id = entity_unit_variable_dimension_id)
84. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_entity_unit_variable_dimension_responsibles_entity_variable (cost=0.00..4.20 rows=6 width=0) (never executed)

  • Index Cond: (entity_unit_variable_dimension_id = e_1.id)
85. 0.000 0.000 ↓ 0.0 0

Index Scan using user_groups_pkey on user_groups ug_3 (cost=0.14..2.15 rows=1 width=5) (never executed)

  • Index Cond: (id = evdr_1.user_group_id)
86. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_lnk_user_user_groups_user_group_id on lnk_user_user_groups luug_3 (cost=0.14..1.10 rows=2 width=8) (never executed)

  • Index Cond: (user_group_id = ug_3.id)
87. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on users u_3 (cost=0.13..2.15 rows=1 width=4) (never executed)

  • Index Cond: (id = COALESCE(evdr_1.user_id, luug_3.user_id))
  • Filter: ((external_id)::text = '79f30646-d7b1-11e8-8dbb-f2801f1b9fd1'::text)
Planning time : 17.164 ms