explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LXXH

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

Result (cost=357.18..357.19 rows=1 width=41) (actual time=2.304..2.304 rows=1 loops=1)

2.          

CTE __local_0__

3. 0.006 0.704 ↑ 1.0 1 1

Limit (cost=0.28..175.33 rows=1 width=89) (actual time=0.699..0.704 rows=1 loops=1)

4. 0.066 0.698 ↑ 6,454.0 1 1

Index Scan using employee_job_position_type_id_is_archived on employee __local_1__ (cost=0.28..1,129,753.02 rows=6,454 width=89) (actual time=0.698..0.698 rows=1 loops=1)

  • Index Cond: (is_archived = false)
  • Filter: (is_archived IS FALSE)
5.          

SubPlan (forIndex Scan)

6. 0.314 0.314 ↑ 1.0 1 1

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

7. 0.004 0.233 ↑ 1.0 1 1

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

8.          

CTE __local_3__

9. 0.010 0.214 ↑ 2.5 2 1

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

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

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

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

SubPlan (forBitmap Heap Scan)

13. 0.066 0.138 ↑ 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.069 rows=1 loops=2)

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

SubPlan (forSeq Scan)

15. 0.004 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.008 0.012 ↓ 0.0 0 2

Sort (cost=14.48..14.50 rows=7 width=64) (actual time=0.006..0.006 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.018 0.018 ↑ 1.0 1 2

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

25. 0.004 0.050 ↑ 1.0 1 2

Result (cost=5.78..5.79 rows=1 width=32) (actual time=0.025..0.025 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.002 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.042 0.042 ↓ 0.0 0 2

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

32.          

Initplan (forResult)

33. 0.046 0.046 ↑ 1.0 1 2

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

34.          

CTE __local_12__

35. 0.007 0.227 ↑ 1.0 1 1

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

36. 0.220 0.220 ↑ 2.5 2 1

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

37.          

Initplan (forResult)

38. 0.229 0.229 ↑ 1.0 1 1

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

39. 0.025 0.085 ↑ 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.085..0.085 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.055 ↑ 1.0 1 1

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

43.          

CTE __local_15__

44. 0.030 0.043 ↑ 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.042..0.043 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.012..0.013 rows=1 loops=1)

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

CTE __local_18__

48. 0.004 0.051 ↑ 1.0 1 1

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

49. 0.047 0.047 ↑ 1.0 1 1

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

50.          

Initplan (forResult)

51. 0.052 0.052 ↑ 1.0 1 1

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

52.          

CTE __local_19__

53. 0.008 0.718 ↑ 1.0 1 1

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

54. 0.710 0.710 ↑ 1.0 1 1

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

55.          

Initplan (forResult)

56. 0.721 0.721 ↑ 1.0 1 1

CTE Scan on __local_19__ (cost=0.00..0.02 rows=1 width=32) (actual time=0.720..0.721 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.002..0.002 rows=1 loops=1)

60. 0.386 1.557 ↑ 1.0 1 1

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

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

  • Filter: (is_archived IS FALSE)