explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4uRP

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 19.322 ↑ 1.0 1 1

Result (cost=603.04..603.05 rows=1 width=41) (actual time=19.322..19.322 rows=1 loops=1)

2.          

CTE __local_0__

3. 0.010 17.569 ↑ 1.0 1 1

Limit (cost=246.22..421.19 rows=1 width=89) (actual time=17.561..17.569 rows=1 loops=1)

4. 0.055 17.559 ↑ 6,454.0 1 1

Result (cost=246.22..1,129,527.48 rows=6,454 width=89) (actual time=17.559..17.559 rows=1 loops=1)

5. 2.218 16.471 ↑ 6,454.0 1 1

Sort (cost=246.22..262.35 rows=6,454 width=225) (actual time=16.471..16.471 rows=1 loops=1)

  • Sort Key: __local_1__.job_position_type, __local_1__.id
  • Sort Method: top-N heapsort Memory: 26kB
6. 14.253 14.253 ↑ 1.0 6,454 1

Seq Scan on employee __local_1__ (cost=0.00..213.95 rows=6,454 width=225) (actual time=0.029..14.253 rows=6,454 loops=1)

  • Filter: (is_archived IS FALSE)
7.          

SubPlan (forResult)

8. 0.649 0.649 ↑ 1.0 1 1

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

9. 0.005 0.244 ↑ 1.0 1 1

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

10.          

CTE __local_3__

11. 0.016 0.220 ↑ 2.5 2 1

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

  • Sort Key: __local_4__.id
  • Sort Method: quicksort Memory: 26kB
12. 0.025 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.150..0.204 rows=2 loops=1)

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

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

SubPlan (forBitmap Heap Scan)

15. 0.066 0.160 ↑ 1.0 1 2

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

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

SubPlan (forSeq Scan)

17. 0.006 0.028 ↑ 1.0 1 2

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

18.          

CTE __local_6__

19. 0.010 0.016 ↓ 0.0 0 2

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

  • Sort Key: __local_7__.group_id
  • Sort Method: quicksort Memory: 25kB
20. 0.002 0.006 ↓ 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.003..0.003 rows=0 loops=2)

  • Recheck Cond: (form_field_id = __local_5__.id)
21. 0.004 0.004 ↓ 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.002..0.002 rows=0 loops=2)

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

CTE __local_8__

23. 0.004 0.020 ↑ 1.0 1 2

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

24. 0.016 0.016 ↓ 0.0 0 2

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

25.          

Initplan (forResult)

26. 0.022 0.022 ↑ 1.0 1 2

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

27. 0.006 0.066 ↑ 1.0 1 2

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

28.          

CTE __local_9__

29. 0.006 0.054 ↓ 0.0 0 2

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

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

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

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

CTE __local_11__

32. 0.002 0.058 ↑ 1.0 1 2

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

33. 0.056 0.056 ↓ 0.0 0 2

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

34.          

Initplan (forResult)

35. 0.060 0.060 ↑ 1.0 1 2

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

36.          

CTE __local_12__

37. 0.007 0.235 ↑ 1.0 1 1

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

38. 0.228 0.228 ↑ 2.5 2 1

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

39.          

Initplan (forResult)

40. 0.239 0.239 ↑ 1.0 1 1

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

41. 0.037 0.140 ↑ 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.140..0.140 rows=1 loops=1)

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

SubPlan (forIndex Scan)

43. 0.012 0.012 ↑ 1.0 1 1

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

44. 0.003 0.091 ↑ 1.0 1 1

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

45.          

CTE __local_15__

46. 0.036 0.073 ↑ 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.072..0.073 rows=1 loops=1)

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

SubPlan (forIndex Only Scan)

48. 0.037 0.037 ↑ 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.036..0.037 rows=1 loops=1)

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

CTE __local_18__

50. 0.006 0.085 ↑ 1.0 1 1

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

51. 0.079 0.079 ↑ 1.0 1 1

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

52.          

Initplan (forResult)

53. 0.088 0.088 ↑ 1.0 1 1

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

54.          

CTE __local_19__

55. 0.010 17.586 ↑ 1.0 1 1

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

56. 17.576 17.576 ↑ 1.0 1 1

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

57.          

Initplan (forResult)

58. 17.589 17.589 ↑ 1.0 1 1

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

59. 0.026 0.029 ↑ 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.029..0.029 rows=1 loops=1)

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

SubPlan (forSeq Scan)

61. 0.003 0.003 ↑ 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.003 rows=1 loops=1)

62. 0.421 1.696 ↑ 1.0 1 1

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

63. 1.275 1.275 ↑ 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.004..1.275 rows=6,454 loops=1)

  • Filter: (is_archived IS FALSE)
Planning time : 1.503 ms
Execution time : 19.679 ms