explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q9OT

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 2.283 ↑ 1.0 1 1

Result (cost=357.17..357.18 rows=1 width=41) (actual time=2.283..2.283 rows=1 loops=1)

2.          

CTE __local_0__

3. 0.006 0.681 ↑ 1.0 1 1

Limit (cost=0.28..175.33 rows=1 width=89) (actual time=0.676..0.681 rows=1 loops=1)

4. 0.054 0.675 ↑ 6,454.0 1 1

Index Scan using employee_job_position_type_id on employee __local_1__ (cost=0.28..1,129,736.88 rows=6,454 width=89) (actual time=0.675..0.675 rows=1 loops=1)

  • Filter: (is_archived IS FALSE)
5.          

SubPlan (forIndex Scan)

6. 0.322 0.322 ↑ 1.0 1 1

Function Scan on employee_full_name __local_2__ (cost=0.25..0.26 rows=1 width=32) (actual time=0.321..0.322 rows=1 loops=1)

7. 0.004 0.227 ↑ 1.0 1 1

Result (cost=149.67..149.68 rows=1 width=32) (actual time=0.227..0.227 rows=1 loops=1)

8.          

CTE __local_3__

9. 0.010 0.209 ↑ 2.5 2 1

Sort (cost=149.50..149.51 rows=5 width=48) (actual time=0.209..0.209 rows=2 loops=1)

  • Sort Key: __local_4__.id
  • Sort Method: quicksort Memory: 26kB
10. 0.026 0.199 ↑ 2.5 2 1

Bitmap Heap Scan on form_field_entry __local_4__ (cost=4.32..149.44 rows=5 width=48) (actual time=0.139..0.199 rows=2 loops=1)

  • Recheck Cond: (employee_id = __local_1__.id)
  • Heap Blocks: exact=2
11. 0.027 0.027 ↑ 2.5 2 1

Bitmap Index Scan on form_field_entry_employee_id_index (cost=0.00..4.32 rows=5 width=0) (actual time=0.027..0.027 rows=2 loops=1)

  • Index Cond: (employee_id = __local_1__.id)
12.          

SubPlan (forBitmap Heap Scan)

13. 0.072 0.146 ↑ 1.0 1 2

Seq Scan on form_field __local_5__ (cost=0.00..25.75 rows=1 width=32) (actual time=0.066..0.073 rows=1 loops=2)

  • Filter: (__local_4__.form_field_id = id)
  • Rows Removed by Filter: 178
14.          

SubPlan (forSeq Scan)

15. 0.006 0.022 ↑ 1.0 1 2

Result (cost=14.71..14.72 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=2)

16.          

CTE __local_6__

17. 0.006 0.010 ↓ 0.0 0 2

Sort (cost=14.48..14.50 rows=7 width=64) (actual time=0.005..0.005 rows=0 loops=2)

  • Sort Key: __local_7__.group_id
  • Sort Method: quicksort Memory: 25kB
18. 0.002 0.004 ↓ 0.0 0 2

Bitmap Heap Scan on form_field_group_read __local_7__ (cost=4.21..14.39 rows=7 width=64) (actual time=0.002..0.002 rows=0 loops=2)

  • Recheck Cond: (form_field_id = __local_5__.id)
19. 0.002 0.002 ↓ 0.0 0 2

Bitmap Index Scan on form_field_group_read_form_field_id_index (cost=0.00..4.21 rows=7 width=0) (actual time=0.001..0.001 rows=0 loops=2)

  • Index Cond: (form_field_id = __local_5__.id)
20.          

CTE __local_8__

21. 0.002 0.014 ↑ 1.0 1 2

Aggregate (cost=0.18..0.19 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=2)

22. 0.012 0.012 ↓ 0.0 0 2

CTE Scan on __local_6__ (cost=0.00..0.14 rows=7 width=24) (actual time=0.006..0.006 rows=0 loops=2)

23.          

Initplan (forResult)

24. 0.016 0.016 ↑ 1.0 1 2

CTE Scan on __local_8__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.008..0.008 rows=1 loops=2)

25. 0.004 0.052 ↑ 1.0 1 2

Result (cost=5.78..5.79 rows=1 width=32) (actual time=0.026..0.026 rows=1 loops=2)

26.          

CTE __local_9__

27. 0.004 0.042 ↓ 0.0 0 2

Sort (cost=5.63..5.64 rows=4 width=48) (actual time=0.021..0.021 rows=0 loops=2)

  • Sort Key: __local_10__.id
  • Sort Method: quicksort Memory: 25kB
28. 0.038 0.038 ↓ 0.0 0 2

Seq Scan on form_field_option __local_10__ (cost=0.00..5.59 rows=4 width=48) (actual time=0.019..0.019 rows=0 loops=2)

  • Filter: (form_field_id = __local_5__.id)
  • Rows Removed by Filter: 206
29.          

CTE __local_11__

30. 0.000 0.044 ↑ 1.0 1 2

Aggregate (cost=0.10..0.11 rows=1 width=32) (actual time=0.022..0.022 rows=1 loops=2)

31. 0.044 0.044 ↓ 0.0 0 2

CTE Scan on __local_9__ (cost=0.00..0.08 rows=4 width=24) (actual time=0.022..0.022 rows=0 loops=2)

32.          

Initplan (forResult)

33. 0.048 0.048 ↑ 1.0 1 2

CTE Scan on __local_11__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.024..0.024 rows=1 loops=2)

34.          

CTE __local_12__

35. 0.006 0.221 ↑ 1.0 1 1

Aggregate (cost=0.13..0.14 rows=1 width=32) (actual time=0.221..0.221 rows=1 loops=1)

36. 0.215 0.215 ↑ 2.5 2 1

CTE Scan on __local_3__ (cost=0.00..0.10 rows=5 width=24) (actual time=0.214..0.215 rows=2 loops=1)

37.          

Initplan (forResult)

38. 0.223 0.223 ↑ 1.0 1 1

CTE Scan on __local_12__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.223..0.223 rows=1 loops=1)

39. 0.024 0.072 ↑ 1.0 1 1

Index Scan using user_pkey on "user" __local_14__ (cost=0.28..25.00 rows=1 width=32) (actual time=0.071..0.072 rows=1 loops=1)

  • Index Cond: (__local_1__.user_id = id)
40.          

SubPlan (forIndex Scan)

41. 0.005 0.005 ↑ 1.0 1 1

Function Scan on __local_13__ (cost=0.01..0.02 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=1)

42. 0.003 0.043 ↑ 1.0 1 1

Result (cost=16.66..16.68 rows=1 width=32) (actual time=0.042..0.043 rows=1 loops=1)

43.          

CTE __local_15__

44. 0.019 0.029 ↑ 1.0 1 1

Index Only Scan using user_department_pkey on user_department __local_17__ (cost=0.28..16.61 rows=1 width=64) (actual time=0.029..0.029 rows=1 loops=1)

  • Index Cond: (user_id = __local_14__.id)
  • Heap Fetches: 1
45.          

SubPlan (forIndex Only Scan)

46. 0.010 0.010 ↑ 1.0 1 1

Index Scan using department_pkey on department __local_16__ (cost=0.28..8.30 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (__local_17__.department_id = id)
47.          

CTE __local_18__

48. 0.004 0.038 ↑ 1.0 1 1

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=0.038..0.038 rows=1 loops=1)

49. 0.034 0.034 ↑ 1.0 1 1

CTE Scan on __local_15__ (cost=0.00..0.02 rows=1 width=24) (actual time=0.033..0.034 rows=1 loops=1)

50.          

Initplan (forResult)

51. 0.040 0.040 ↑ 1.0 1 1

CTE Scan on __local_18__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.040..0.040 rows=1 loops=1)

52.          

CTE __local_19__

53. 0.008 0.694 ↑ 1.0 1 1

Aggregate (cost=0.03..0.04 rows=1 width=32) (actual time=0.694..0.694 rows=1 loops=1)

54. 0.686 0.686 ↑ 1.0 1 1

CTE Scan on __local_0__ (cost=0.00..0.02 rows=1 width=24) (actual time=0.681..0.686 rows=1 loops=1)

55.          

Initplan (forResult)

56. 0.700 0.700 ↑ 1.0 1 1

CTE Scan on __local_19__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.699..0.700 rows=1 loops=1)

57. 0.017 0.019 ↑ 3,227.0 1 1

Seq Scan on employee __local_1___1 (cost=0.03..246.24 rows=3,227 width=0) (actual time=0.019..0.019 rows=1 loops=1)

  • Filter: ((is_archived IS FALSE) AND (NOT (hashed SubPlan 25)))
58.          

SubPlan (forSeq Scan)

59. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on __local_0__ __local_0___1 (cost=0.00..0.03 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=1)

60. 0.378 1.559 ↑ 1.0 1 1

Aggregate (cost=181.68..181.69 rows=1 width=8) (actual time=1.559..1.559 rows=1 loops=1)

61. 1.181 1.181 ↑ 1.0 6,454 1

Seq Scan on employee __local_1___2 (cost=0.00..165.54 rows=6,454 width=0) (actual time=0.003..1.181 rows=6,454 loops=1)

  • Filter: (is_archived IS FALSE)
Planning time : 0.959 ms
Execution time : 2.622 ms