explain.depesz.com

PostgreSQL's explain analyze made readable

Result: beMv

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

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

2.          

CTE __local_0__

3. 0.014 85.318 ↑ 1.0 1 1

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

4. 0.053 85.304 ↑ 6,454.0 1 1

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

5. 3.296 84.007 ↑ 6,454.0 1 1

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

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

7.          

SubPlan (forResult)

8. 0.549 0.549 ↑ 1.0 1 1

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

9. 0.014 0.349 ↑ 1.0 1 1

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

10.          

CTE __local_3__

11. 0.016 0.323 ↓ 0.0 0 1

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

  • Sort Key: __local_4__.id
  • Sort Method: quicksort Memory: 25kB
12. 0.003 0.307 ↓ 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.307..0.307 rows=0 loops=1)

  • Recheck Cond: (employee_id = __local_1__.id)
13. 0.304 0.304 ↓ 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.303..0.304 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.006 0.330 ↑ 1.0 1 1

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

38. 0.324 0.324 ↓ 0.0 0 1

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

39.          

Initplan (forResult)

40. 0.335 0.335 ↑ 1.0 1 1

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

41. 0.054 0.346 ↑ 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.346..0.346 rows=1 loops=1)

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

SubPlan (forIndex Scan)

43. 0.013 0.013 ↑ 1.0 1 1

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

44. 0.007 0.279 ↑ 1.0 1 1

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

45.          

CTE __local_15__

46. 0.169 0.244 ↑ 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.243..0.244 rows=1 loops=1)

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

SubPlan (forIndex Only Scan)

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

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

CTE __local_18__

50. 0.011 0.269 ↑ 1.0 1 1

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

51. 0.258 0.258 ↑ 1.0 1 1

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

52.          

Initplan (forResult)

53. 0.272 0.272 ↑ 1.0 1 1

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

54.          

CTE __local_19__

55. 0.017 85.348 ↑ 1.0 1 1

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

56. 85.331 85.331 ↑ 1.0 1 1

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

57.          

Initplan (forResult)

58. 85.353 85.353 ↑ 1.0 1 1

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

59. 0.473 0.475 ↑ 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.475..0.475 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.388 1.143 ↑ 1.0 1 1

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

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