explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R7ru

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 2.476 ↑ 1.0 1 1

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

2.          

CTE __local_0__

3. 0.006 0.694 ↑ 1.0 1 1

Limit (cost=0.28..175.33 rows=1 width=89) (actual time=0.689..0.694 rows=1 loops=1)

4. 0.055 0.688 ↑ 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.688..0.688 rows=1 loops=1)

  • Filter: (is_archived IS FALSE)
5.          

SubPlan (forIndex Scan)

6. 0.349 0.349 ↑ 1.0 1 1

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

7. 0.004 0.200 ↑ 1.0 1 1

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

8.          

CTE __local_3__

9. 0.011 0.181 ↑ 2.5 2 1

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

  • Sort Key: __local_4__.id
  • Sort Method: quicksort Memory: 26kB
10. 0.018 0.170 ↑ 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.117..0.170 rows=2 loops=1)

  • Recheck Cond: (employee_id = __local_1__.id)
  • Heap Blocks: exact=2
11. 0.012 0.012 ↑ 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.012..0.012 rows=2 loops=1)

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

SubPlan (forBitmap Heap Scan)

13. 0.062 0.140 ↑ 1.0 1 2

Seq Scan on form_field __local_5__ (cost=0.00..25.75 rows=1 width=32) (actual time=0.061..0.070 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.002 0.056 ↑ 1.0 1 2

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

26.          

CTE __local_9__

27. 0.004 0.048 ↓ 0.0 0 2

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

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

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

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

CTE __local_11__

30. 0.002 0.050 ↑ 1.0 1 2

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

31. 0.048 0.048 ↓ 0.0 0 2

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

32.          

Initplan (forResult)

33. 0.054 0.054 ↑ 1.0 1 2

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

34.          

CTE __local_12__

35. 0.007 0.194 ↑ 1.0 1 1

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

36. 0.187 0.187 ↑ 2.5 2 1

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

37.          

Initplan (forResult)

38. 0.196 0.196 ↑ 1.0 1 1

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

39. 0.027 0.084 ↑ 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.084..0.084 rows=1 loops=1)

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

SubPlan (forIndex Scan)

41. 0.006 0.006 ↑ 1.0 1 1

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

42. 0.003 0.051 ↑ 1.0 1 1

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

43.          

CTE __local_15__

44. 0.025 0.038 ↑ 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.037..0.038 rows=1 loops=1)

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

SubPlan (forIndex Only Scan)

46. 0.013 0.013 ↑ 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.013..0.013 rows=1 loops=1)

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

CTE __local_18__

48. 0.005 0.047 ↑ 1.0 1 1

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

49. 0.042 0.042 ↑ 1.0 1 1

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

50.          

Initplan (forResult)

51. 0.048 0.048 ↑ 1.0 1 1

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

52.          

CTE __local_19__

53. 0.008 0.708 ↑ 1.0 1 1

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

54. 0.700 0.700 ↑ 1.0 1 1

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

55.          

Initplan (forResult)

56. 0.712 0.712 ↑ 1.0 1 1

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

57. 0.019 0.021 ↑ 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.021..0.021 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.001..0.002 rows=1 loops=1)

60. 0.396 1.737 ↑ 1.0 1 1

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

61. 1.341 1.341 ↑ 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.341 rows=6,454 loops=1)

  • Filter: (is_archived IS FALSE)
Planning time : 1.006 ms
Execution time : 2.725 ms