explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Zzm

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 84.862 ↑ 1.0 1 1

Result (cost=2,169.13..2,169.14 rows=1 width=41) (actual time=84.862..84.862 rows=1 loops=1)

2.          

CTE __local_0__

3. 0.013 83.298 ↑ 1.0 1 1

Limit (cost=1,811.31..1,986.78 rows=1 width=112) (actual time=83.286..83.298 rows=1 loops=1)

4. 0.045 83.285 ↑ 6,454.0 1 1

Result (cost=1,811.31..1,134,319.57 rows=6,454 width=112) (actual time=83.285..83.285 rows=1 loops=1)

5. 3.230 82.353 ↑ 6,454.0 1 1

Sort (cost=1,811.31..1,827.44 rows=6,454 width=225) (actual time=82.353..82.353 rows=1 loops=1)

  • Sort Key: (employee_full_name(__local_1__.*)), __local_1__.id
  • Sort Method: top-N heapsort Memory: 25kB
6. 79.123 79.123 ↑ 1.0 6,454 1

Seq Scan on employee __local_1__ (cost=0.00..1,779.04 rows=6,454 width=225) (actual time=0.757..79.123 rows=6,454 loops=1)

7.          

SubPlan (forResult)

8. 0.539 0.539 ↑ 1.0 1 1

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

9. 0.008 0.038 ↑ 1.0 1 1

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

10.          

CTE __local_3__

11. 0.012 0.023 ↓ 0.0 0 1

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

  • Sort Key: __local_4__.id
  • Sort Method: quicksort Memory: 25kB
12. 0.004 0.011 ↓ 0.0 0 1

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

  • Recheck Cond: (employee_id = __local_1__.id)
13. 0.007 0.007 ↓ 0.0 0 1

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

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

SubPlan (forBitmap Heap Scan)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on form_field __local_5__ (cost=0.00..25.75 rows=1 width=32) (never executed)

  • Filter: (__local_4__.form_field_id = id)
16.          

SubPlan (forSeq Scan)

17. 0.000 0.000 ↓ 0.0 0

Result (cost=14.71..14.72 rows=1 width=32) (never executed)

18.          

CTE __local_6__

19. 0.000 0.000 ↓ 0.0 0

Sort (cost=14.48..14.50 rows=7 width=64) (never executed)

  • Sort Key: __local_7__.group_id
20. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on form_field_group_read __local_7__ (cost=4.21..14.39 rows=7 width=64) (never executed)

  • Recheck Cond: (form_field_id = __local_5__.id)
21. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on form_field_group_read_form_field_id_index (cost=0.00..4.21 rows=7 width=0) (never executed)

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

CTE __local_8__

23. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=0.18..0.19 rows=1 width=32) (never executed)

24. 0.000 0.000 ↓ 0.0 0

CTE Scan on __local_6__ (cost=0.00..0.14 rows=7 width=24) (never executed)

25.          

Initplan (forResult)

26. 0.000 0.000 ↓ 0.0 0

CTE Scan on __local_8__ (cost=0.00..0.02 rows=1 width=32) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Result (cost=5.78..5.79 rows=1 width=32) (never executed)

28.          

CTE __local_9__

29. 0.000 0.000 ↓ 0.0 0

Sort (cost=5.63..5.64 rows=4 width=48) (never executed)

  • Sort Key: __local_10__.id
30. 0.000 0.000 ↓ 0.0 0

Seq Scan on form_field_option __local_10__ (cost=0.00..5.59 rows=4 width=48) (never executed)

  • Filter: (form_field_id = __local_5__.id)
31.          

CTE __local_11__

32. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=0.10..0.11 rows=1 width=32) (never executed)

33. 0.000 0.000 ↓ 0.0 0

CTE Scan on __local_9__ (cost=0.00..0.08 rows=4 width=24) (never executed)

34.          

Initplan (forResult)

35. 0.000 0.000 ↓ 0.0 0

CTE Scan on __local_11__ (cost=0.00..0.02 rows=1 width=32) (never executed)

36.          

CTE __local_12__

37. 0.003 0.027 ↑ 1.0 1 1

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

38. 0.024 0.024 ↓ 0.0 0 1

CTE Scan on __local_3__ (cost=0.00..0.10 rows=5 width=24) (actual time=0.024..0.024 rows=0 loops=1)

39.          

Initplan (forResult)

40. 0.030 0.030 ↑ 1.0 1 1

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

41. 0.082 0.310 ↑ 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.309..0.310 rows=1 loops=1)

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

SubPlan (forIndex Scan)

43. 0.038 0.038 ↑ 1.0 1 1

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

44. 0.003 0.190 ↑ 1.0 1 1

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

45.          

CTE __local_15__

46. 0.117 0.151 ↑ 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.151..0.151 rows=1 loops=1)

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

SubPlan (forIndex Only Scan)

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

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

CTE __local_18__

50. 0.005 0.184 ↑ 1.0 1 1

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

51. 0.179 0.179 ↑ 1.0 1 1

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

52.          

Initplan (forResult)

53. 0.187 0.187 ↑ 1.0 1 1

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

54.          

CTE __local_19__

55. 0.009 83.314 ↑ 1.0 1 1

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

56. 83.305 83.305 ↑ 1.0 1 1

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

57.          

Initplan (forResult)

58. 83.317 83.317 ↑ 1.0 1 1

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

59. 0.456 0.458 ↑ 3,227.0 1 1

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

  • Filter: (NOT (hashed SubPlan 25))
60.          

SubPlan (forSeq Scan)

61. 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)

62. 0.378 1.080 ↑ 1.0 1 1

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

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