explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t0ra

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

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

2.          

CTE __local_0__

3. 0.012 80.527 ↑ 1.0 1 1

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

4. 0.048 80.515 ↑ 6,454.0 1 1

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

5. 3.090 79.781 ↑ 6,454.0 1 1

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

  • Sort Key: (employee_full_name(__local_1__.*)), __local_1__.id
  • Sort Method: top-N heapsort Memory: 25kB
6. 76.691 76.691 ↑ 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.458..76.691 rows=6,454 loops=1)

7.          

SubPlan (forResult)

8. 0.500 0.500 ↑ 1.0 1 1

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

9. 0.007 0.034 ↑ 1.0 1 1

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

10.          

CTE __local_3__

11. 0.011 0.021 ↓ 0.0 0 1

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

  • Sort Key: __local_4__.id
  • Sort Method: quicksort Memory: 25kB
12. 0.003 0.010 ↓ 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.010..0.010 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.024 ↑ 1.0 1 1

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

38. 0.021 0.021 ↓ 0.0 0 1

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

39.          

Initplan (forResult)

40. 0.027 0.027 ↑ 1.0 1 1

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

41. 0.035 0.152 ↑ 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.152..0.152 rows=1 loops=1)

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

SubPlan (forIndex Scan)

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

44. 0.004 0.111 ↑ 1.0 1 1

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

45.          

CTE __local_15__

46. 0.071 0.087 ↑ 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.087..0.087 rows=1 loops=1)

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

SubPlan (forIndex Only Scan)

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

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

CTE __local_18__

50. 0.006 0.105 ↑ 1.0 1 1

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

51. 0.099 0.099 ↑ 1.0 1 1

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

52.          

Initplan (forResult)

53. 0.107 0.107 ↑ 1.0 1 1

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

54.          

CTE __local_19__

55. 0.011 80.544 ↑ 1.0 1 1

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

56. 80.533 80.533 ↑ 1.0 1 1

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

57.          

Initplan (forResult)

58. 80.547 80.547 ↑ 1.0 1 1

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

59. 0.642 0.645 ↑ 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.644..0.645 rows=1 loops=1)

  • Filter: (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.496 1.343 ↑ 1.0 1 1

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

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

Planning time : 1.233 ms
Execution time : 83.079 ms