explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RTFB

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 1,063.291 ↓ 20.0 20 1

Limit (cost=44,224.05..44,224.05 rows=1 width=268) (actual time=1,063.286..1,063.291 rows=20 loops=1)

2.          

CTE with_users

3. 0.932 0.932 ↓ 2.5 251 1

Function Scan on json_to_recordset (cost=0.00..1.00 rows=100 width=172) (actual time=0.912..0.932 rows=251 loops=1)

4.          

CTE with_user_periods_inside_team

5. 0.620 0.620 ↓ 2.5 251 1

Function Scan on json_to_recordset json_to_recordset_1 (cost=0.00..1.00 rows=100 width=20) (actual time=0.599..0.620 rows=251 loops=1)

6.          

CTE with_last_followed_project

7. 0.224 17.684 ↓ 1.9 123 1

GroupAggregate (cost=1,348.48..1,349.63 rows=66 width=12) (actual time=17.345..17.684 rows=123 loops=1)

  • Group Key: with_users.user_id
8. 0.341 17.460 ↓ 14.5 958 1

Sort (cost=1,348.48..1,348.64 rows=66 width=12) (actual time=17.340..17.460 rows=958 loops=1)

  • Sort Key: with_users.user_id
  • Sort Method: quicksort Memory: 69kB
9. 0.313 17.119 ↓ 14.5 958 1

Hash Join (cost=6.50..1,346.48 rows=66 width=12) (actual time=0.547..17.119 rows=958 loops=1)

  • Hash Cond: (cfp.user_id = with_users.user_id)
10. 9.165 16.687 ↓ 14.5 958 1

Hash Join (cost=3.25..1,342.98 rows=66 width=16) (actual time=0.421..16.687 rows=958 loops=1)

  • Hash Cond: (cfp.user_id = with_user_periods_inside_team.user_id)
  • Join Filter: ((cfp.followed_at >= with_user_periods_inside_team.team_joining_date) AND (cfp.followed_at <= COALESCE(with_user_periods_inside_team.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 30
11. 7.441 7.441 ↓ 1.0 60,512 1

Seq Scan on claire_followed_project cfp (cost=0.00..1,103.99 rows=60,499 width=12) (actual time=0.019..7.441 rows=60,512 loops=1)

12. 0.050 0.081 ↓ 2.5 251 1

Hash (cost=2.00..2.00 rows=100 width=20) (actual time=0.081..0.081 rows=251 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 20kB
13. 0.031 0.031 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team (cost=0.00..2.00 rows=100 width=20) (actual time=0.001..0.031 rows=251 loops=1)

14. 0.062 0.119 ↓ 2.5 251 1

Hash (cost=2.00..2.00 rows=100 width=4) (actual time=0.119..0.119 rows=251 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
15. 0.057 0.057 ↓ 2.5 251 1

CTE Scan on with_users (cost=0.00..2.00 rows=100 width=4) (actual time=0.001..0.057 rows=251 loops=1)

16.          

CTE with_completed_courses

17. 0.097 66.664 ↓ 165.2 661 1

Unique (cost=6,874.08..6,874.13 rows=4 width=8) (actual time=66.387..66.664 rows=661 loops=1)

18. 0.120 66.567 ↓ 165.2 661 1

Group (cost=6,874.08..6,874.11 rows=4 width=8) (actual time=66.386..66.567 rows=661 loops=1)

  • Group Key: with_users_1.user_id, ccc.reference_course_id
19. 0.258 66.447 ↓ 165.2 661 1

Sort (cost=6,874.08..6,874.09 rows=4 width=8) (actual time=66.382..66.447 rows=661 loops=1)

  • Sort Key: with_users_1.user_id, ccc.reference_course_id
  • Sort Method: quicksort Memory: 55kB
20. 0.451 66.189 ↓ 165.2 661 1

HashAggregate (cost=6,873.96..6,874.00 rows=4 width=8) (actual time=66.120..66.189 rows=661 loops=1)

  • Group Key: with_users_1.user_id, ccc.reference_course_id
21. 0.120 65.738 ↓ 317.5 1,270 1

Append (cost=0.85..6,873.94 rows=4 width=8) (actual time=0.044..65.738 rows=1,270 loops=1)

22. 3.052 9.502 ↓ 154.0 154 1

Nested Loop (cost=0.85..1,455.36 rows=1 width=8) (actual time=0.044..9.502 rows=154 loops=1)

  • Join Filter: (ccc.user_id = with_users_1.user_id)
  • Rows Removed by Join Filter: 38,500
23. 0.142 3.216 ↓ 154.0 154 1

Nested Loop (cost=0.85..1,452.11 rows=1 width=16) (actual time=0.022..3.216 rows=154 loops=1)

  • Join Filter: ((cfch.followed_at >= with_user_periods_inside_team_1.team_joining_date) AND (cfch.followed_at <= COALESCE(with_user_periods_inside_team_1.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 1
24. 0.084 0.609 ↓ 4.8 145 1

Nested Loop (cost=0.42..1,368.73 rows=30 width=28) (actual time=0.010..0.609 rows=145 loops=1)

25. 0.023 0.023 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_1 (cost=0.00..2.00 rows=100 width=20) (actual time=0.000..0.023 rows=251 loops=1)

26. 0.502 0.502 ↑ 1.0 1 251

Index Scan using idx_48cd04a5a76ed395 on claire_completed_course ccc (cost=0.42..13.66 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_1.user_id)
  • Filter: ((completed_at >= with_user_periods_inside_team_1.team_joining_date) AND (completed_at <= COALESCE(with_user_periods_inside_team_1.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 0
27. 2.465 2.465 ↑ 1.0 1 145

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch (cost=0.43..2.76 rows=1 width=16) (actual time=0.010..0.017 rows=1 loops=145)

  • Index Cond: (user_id = ccc.user_id)
  • Filter: (ccc.reference_course_id = reference_id)
  • Rows Removed by Filter: 39
28. 3.234 3.234 ↓ 2.5 251 154

CTE Scan on with_users with_users_1 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.021 rows=251 loops=154)

29. 23.431 56.116 ↓ 372.0 1,116 1

Nested Loop (cost=0.86..5,418.53 rows=3 width=8) (actual time=19.015..56.116 rows=1,116 loops=1)

  • Join Filter: (cucr.user_id = with_users_2.user_id)
  • Rows Removed by Join Filter: 279,000
30. 0.055 0.055 ↓ 2.5 251 1

CTE Scan on with_users with_users_2 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.055 rows=251 loops=1)

31. 13.739 32.630 ↓ 279.0 1,116 251

Materialize (cost=0.86..5,410.54 rows=4 width=16) (actual time=0.000..0.130 rows=1,116 loops=251)

32. 0.886 18.891 ↓ 279.0 1,116 1

Nested Loop (cost=0.86..5,410.52 rows=4 width=16) (actual time=0.019..18.891 rows=1,116 loops=1)

  • Join Filter: ((cfch_1.followed_at >= with_user_periods_inside_team_2.team_joining_date) AND (cfch_1.followed_at <= COALESCE(with_user_periods_inside_team_2.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 109
33. 0.261 1.555 ↓ 6.8 1,175 1

Nested Loop (cost=0.43..5,230.19 rows=173 width=28) (actual time=0.010..1.555 rows=1,175 loops=1)

34. 0.039 0.039 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_2 (cost=0.00..2.00 rows=100 width=20) (actual time=0.000..0.039 rows=251 loops=1)

35. 1.255 1.255 ↓ 2.5 5 251

Index Scan using idx_2553bf7aa76ed395 on claire_user_course_result cucr (cost=0.43..52.26 rows=2 width=16) (actual time=0.003..0.005 rows=5 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_2.user_id)
  • Filter: (passed AND (created_at >= with_user_periods_inside_team_2.team_joining_date) AND (created_at <= COALESCE(with_user_periods_inside_team_2.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 1
36. 16.450 16.450 ↑ 1.0 1 1,175

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_1 (cost=0.43..1.03 rows=1 width=16) (actual time=0.009..0.014 rows=1 loops=1,175)

  • Index Cond: (user_id = cucr.user_id)
  • Filter: (cucr.reference_id = reference_id)
  • Rows Removed by Filter: 40
37.          

CTE with_number_of_followed_courses

38. 1.172 193.716 ↓ 2.0 201 1

GroupAggregate (cost=11.08..5,422.41 rows=100 width=12) (actual time=67.718..193.716 rows=201 loops=1)

  • Group Key: with_users_3.user_id
39. 2.508 192.544 ↓ 20.2 2,083 1

Nested Loop (cost=11.08..5,420.89 rows=103 width=8) (actual time=67.613..192.544 rows=2,083 loops=1)

  • Join Filter: ((with_users_3.user_id = cfch_2.user_id) AND (NOT (SubPlan 5)))
  • Rows Removed by Join Filter: 640
40. 0.160 1.107 ↓ 2.5 251 1

Merge Join (cost=10.64..12.64 rows=100 width=24) (actual time=0.842..1.107 rows=251 loops=1)

  • Merge Cond: (with_users_3.user_id = with_user_periods_inside_team_3.user_id)
41. 0.079 0.172 ↓ 2.5 251 1

Sort (cost=5.32..5.57 rows=100 width=4) (actual time=0.127..0.172 rows=251 loops=1)

  • Sort Key: with_users_3.user_id
  • Sort Method: quicksort Memory: 36kB
42. 0.093 0.093 ↓ 2.5 251 1

CTE Scan on with_users with_users_3 (cost=0.00..2.00 rows=100 width=4) (actual time=0.001..0.093 rows=251 loops=1)

43. 0.099 0.775 ↓ 2.5 251 1

Sort (cost=5.32..5.57 rows=100 width=20) (actual time=0.712..0.775 rows=251 loops=1)

  • Sort Key: with_user_periods_inside_team_3.user_id
  • Sort Method: quicksort Memory: 36kB
44. 0.676 0.676 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_3 (cost=0.00..2.00 rows=100 width=20) (actual time=0.601..0.676 rows=251 loops=1)

45. 3.765 3.765 ↓ 5.5 11 251

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_2 (cost=0.43..53.96 rows=2 width=16) (actual time=0.005..0.015 rows=11 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_3.user_id)
  • Filter: ((unfollowed_at IS NULL) AND (followed_at >= with_user_periods_inside_team_3.team_joining_date) AND (followed_at <= COALESCE(with_user_periods_inside_team_3.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 6
46.          

SubPlan (for Nested Loop)

47. 185.164 185.164 ↓ 7.0 7 2,723

CTE Scan on with_completed_courses (cost=0.00..0.09 rows=1 width=4) (actual time=0.054..0.068 rows=7 loops=2,723)

  • Filter: (user_id = with_users_3.user_id)
  • Rows Removed by Filter: 577
48.          

CTE with_number_of_started_courses

49. 1.155 5.973 ↓ 2.1 215 1

GroupAggregate (cost=11.08..5,413.25 rows=100 width=12) (actual time=0.229..5.973 rows=215 loops=1)

  • Group Key: with_users_4.user_id
50. 0.648 4.818 ↓ 14.4 3,197 1

Nested Loop (cost=11.08..5,411.14 rows=222 width=8) (actual time=0.189..4.818 rows=3,197 loops=1)

  • Join Filter: (with_users_4.user_id = cfch_3.user_id)
51. 0.151 0.405 ↓ 2.5 251 1

Merge Join (cost=10.64..12.64 rows=100 width=24) (actual time=0.173..0.405 rows=251 loops=1)

  • Merge Cond: (with_users_4.user_id = with_user_periods_inside_team_4.user_id)
52. 0.088 0.124 ↓ 2.5 251 1

Sort (cost=5.32..5.57 rows=100 width=4) (actual time=0.084..0.124 rows=251 loops=1)

  • Sort Key: with_users_4.user_id
  • Sort Method: quicksort Memory: 36kB
53. 0.036 0.036 ↓ 2.5 251 1

CTE Scan on with_users with_users_4 (cost=0.00..2.00 rows=100 width=4) (actual time=0.001..0.036 rows=251 loops=1)

54. 0.105 0.130 ↓ 2.5 251 1

Sort (cost=5.32..5.57 rows=100 width=20) (actual time=0.086..0.130 rows=251 loops=1)

  • Sort Key: with_user_periods_inside_team_4.user_id
  • Sort Method: quicksort Memory: 36kB
55. 0.025 0.025 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_4 (cost=0.00..2.00 rows=100 width=20) (actual time=0.001..0.025 rows=251 loops=1)

56. 3.765 3.765 ↓ 6.5 13 251

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_3 (cost=0.43..53.96 rows=2 width=16) (actual time=0.004..0.015 rows=13 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_4.user_id)
  • Filter: ((followed_at >= with_user_periods_inside_team_4.team_joining_date) AND (followed_at <= COALESCE(with_user_periods_inside_team_4.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 4
57.          

CTE with_number_of_course_completed

58. 0.454 81.211 ↓ 38.5 154 1

GroupAggregate (cost=6,874.08..6,874.15 rows=4 width=12) (actual time=80.662..81.211 rows=154 loops=1)

  • Group Key: with_users_5.user_id
59. 0.318 80.757 ↓ 165.2 661 1

Sort (cost=6,874.08..6,874.09 rows=4 width=8) (actual time=80.649..80.757 rows=661 loops=1)

  • Sort Key: with_users_5.user_id
  • Sort Method: quicksort Memory: 55kB
60. 0.640 80.439 ↓ 165.2 661 1

HashAggregate (cost=6,873.96..6,874.00 rows=4 width=8) (actual time=80.329..80.439 rows=661 loops=1)

  • Group Key: with_users_5.user_id, ccc_1.reference_course_id
61. 0.079 79.799 ↓ 317.5 1,270 1

Append (cost=0.85..6,873.94 rows=4 width=8) (actual time=0.051..79.799 rows=1,270 loops=1)

62. 3.040 10.235 ↓ 154.0 154 1

Nested Loop (cost=0.85..1,455.36 rows=1 width=8) (actual time=0.050..10.235 rows=154 loops=1)

  • Join Filter: (ccc_1.user_id = with_users_5.user_id)
  • Rows Removed by Join Filter: 38,500
63. 0.091 3.345 ↓ 154.0 154 1

Nested Loop (cost=0.85..1,452.11 rows=1 width=16) (actual time=0.026..3.345 rows=154 loops=1)

  • Join Filter: ((cfch_4.followed_at >= with_user_periods_inside_team_5.team_joining_date) AND (cfch_4.followed_at <= COALESCE(with_user_periods_inside_team_5.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 1
64. 0.112 0.644 ↓ 4.8 145 1

Nested Loop (cost=0.42..1,368.73 rows=30 width=28) (actual time=0.013..0.644 rows=145 loops=1)

65. 0.030 0.030 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_5 (cost=0.00..2.00 rows=100 width=20) (actual time=0.001..0.030 rows=251 loops=1)

66. 0.502 0.502 ↑ 1.0 1 251

Index Scan using idx_48cd04a5a76ed395 on claire_completed_course ccc_1 (cost=0.42..13.66 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_5.user_id)
  • Filter: ((completed_at >= with_user_periods_inside_team_5.team_joining_date) AND (completed_at <= COALESCE(with_user_periods_inside_team_5.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 0
67. 2.610 2.610 ↑ 1.0 1 145

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_4 (cost=0.43..2.76 rows=1 width=16) (actual time=0.011..0.018 rows=1 loops=145)

  • Index Cond: (user_id = ccc_1.user_id)
  • Filter: (ccc_1.reference_course_id = reference_id)
  • Rows Removed by Filter: 39
68. 3.850 3.850 ↓ 2.5 251 154

CTE Scan on with_users with_users_5 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.025 rows=251 loops=154)

69. 34.020 69.485 ↓ 372.0 1,116 1

Nested Loop (cost=0.86..5,418.53 rows=3 width=8) (actual time=19.387..69.485 rows=1,116 loops=1)

  • Join Filter: (cucr_1.user_id = with_users_6.user_id)
  • Rows Removed by Join Filter: 279,000
70. 0.074 0.074 ↓ 2.5 251 1

CTE Scan on with_users with_users_6 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.074 rows=251 loops=1)

71. 16.153 35.391 ↓ 279.0 1,116 251

Materialize (cost=0.86..5,410.54 rows=4 width=16) (actual time=0.000..0.141 rows=1,116 loops=251)

72. 0.066 19.238 ↓ 279.0 1,116 1

Nested Loop (cost=0.86..5,410.52 rows=4 width=16) (actual time=0.020..19.238 rows=1,116 loops=1)

  • Join Filter: ((cfch_5.followed_at >= with_user_periods_inside_team_6.team_joining_date) AND (cfch_5.followed_at <= COALESCE(with_user_periods_inside_team_6.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 109
73. 0.259 1.547 ↓ 6.8 1,175 1

Nested Loop (cost=0.43..5,230.19 rows=173 width=28) (actual time=0.009..1.547 rows=1,175 loops=1)

74. 0.033 0.033 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_6 (cost=0.00..2.00 rows=100 width=20) (actual time=0.000..0.033 rows=251 loops=1)

75. 1.255 1.255 ↓ 2.5 5 251

Index Scan using idx_2553bf7aa76ed395 on claire_user_course_result cucr_1 (cost=0.43..52.26 rows=2 width=16) (actual time=0.003..0.005 rows=5 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_6.user_id)
  • Filter: (passed AND (created_at >= with_user_periods_inside_team_6.team_joining_date) AND (created_at <= COALESCE(with_user_periods_inside_team_6.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 1
76. 17.625 17.625 ↑ 1.0 1 1,175

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_5 (cost=0.43..1.03 rows=1 width=16) (actual time=0.009..0.015 rows=1 loops=1,175)

  • Index Cond: (user_id = cucr_1.user_id)
  • Filter: (cucr_1.reference_id = reference_id)
  • Rows Removed by Filter: 40
77.          

CTE with_number_of_learning_hours

78. 0.842 2.963 ↓ 38.5 154 1

GroupAggregate (cost=33.38..33.51 rows=4 width=12) (actual time=2.025..2.963 rows=154 loops=1)

  • Group Key: wcc.user_id
79. 0.223 2.121 ↓ 165.2 661 1

Sort (cost=33.38..33.39 rows=4 width=41) (actual time=2.018..2.121 rows=661 loops=1)

  • Sort Key: wcc.user_id
  • Sort Method: quicksort Memory: 75kB
80. 0.482 1.898 ↓ 165.2 661 1

Nested Loop (cost=0.29..33.34 rows=4 width=41) (actual time=0.017..1.898 rows=661 loops=1)

81. 0.094 0.094 ↓ 165.2 661 1

CTE Scan on with_completed_courses wcc (cost=0.00..0.08 rows=4 width=8) (actual time=0.001..0.094 rows=661 loops=1)

82. 1.322 1.322 ↑ 1.0 1 661

Index Scan using claire_course_metadata_pkey on claire_course_metadata ccm (cost=0.29..8.30 rows=1 width=41) (actual time=0.002..0.002 rows=1 loops=661)

  • Index Cond: (reference_id = wcc.reference_id)
83.          

CTE with_last_completed_chapter

84. 0.035 525.460 ↓ 178.0 178 1

Unique (cost=5,510.47..5,510.49 rows=1 width=90) (actual time=525.377..525.460 rows=178 loops=1)

85. 0.134 525.425 ↓ 187.0 187 1

Sort (cost=5,510.47..5,510.48 rows=1 width=90) (actual time=525.377..525.425 rows=187 loops=1)

  • Sort Key: sub.user_id, sub.date, sub.title, sub.slug, sub.reference_id
  • Sort Method: quicksort Memory: 57kB
86. 0.568 525.291 ↓ 187.0 187 1

Subquery Scan on sub (cost=5,510.43..5,510.46 rows=1 width=90) (actual time=520.380..525.291 rows=187 loops=1)

  • Filter: (sub.rank = 1)
  • Rows Removed by Filter: 7,675
87. 3.547 524.723 ↓ 7,862.0 7,862 1

WindowAgg (cost=5,510.43..5,510.45 rows=1 width=90) (actual time=520.377..524.723 rows=7,862 loops=1)

88. 5.794 521.176 ↓ 7,862.0 7,862 1

Sort (cost=5,510.43..5,510.43 rows=1 width=82) (actual time=520.365..521.176 rows=7,862 loops=1)

  • Sort Key: with_users_7.user_id, ccp.created_at DESC
  • Sort Method: quicksort Memory: 1,475kB
89. 3.005 515.382 ↓ 7,862.0 7,862 1

Nested Loop (cost=2.03..5,510.42 rows=1 width=82) (actual time=0.098..515.382 rows=7,862 loops=1)

90. 159.753 496.653 ↓ 7,862.0 7,862 1

Nested Loop (cost=1.59..5,502.07 rows=1 width=46) (actual time=0.089..496.653 rows=7,862 loops=1)

  • Join Filter: (ccp.user_id = with_users_7.user_id)
  • Rows Removed by Join Filter: 1,965,500
91. 4.269 156.074 ↓ 7,862.0 7,862 1

Nested Loop (cost=1.59..5,498.82 rows=1 width=54) (actual time=0.059..156.074 rows=7,862 loops=1)

  • Join Filter: ((ccp.created_at >= with_user_periods_inside_team_7.team_joining_date) AND (ccp.created_at <= COALESCE(with_user_periods_inside_team_7.team_leaving_date, 'infinity'::timestamp without time zone)) AND (with_user_periods_inside_team_7.user_id = ccp.user_id))
  • Rows Removed by Join Filter: 36
92. 1.381 25.965 ↓ 3,146.0 3,146 1

Nested Loop (cost=1.15..5,477.66 rows=1 width=66) (actual time=0.043..25.965 rows=3,146 loops=1)

93. 0.841 15.146 ↓ 209.7 3,146 1

Nested Loop (cost=0.72..5,470.51 rows=15 width=36) (actual time=0.033..15.146 rows=3,146 loops=1)

94. 0.637 4.714 ↓ 14.4 3,197 1

Nested Loop (cost=0.43..5,400.00 rows=222 width=28) (actual time=0.022..4.714 rows=3,197 loops=1)

95. 0.061 0.061 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_7 (cost=0.00..2.00 rows=100 width=20) (actual time=0.001..0.061 rows=251 loops=1)

96. 4.016 4.016 ↓ 6.5 13 251

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_6 (cost=0.43..53.96 rows=2 width=16) (actual time=0.004..0.016 rows=13 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_7.user_id)
  • Filter: ((followed_at >= with_user_periods_inside_team_7.team_joining_date) AND (followed_at <= COALESCE(with_user_periods_inside_team_7.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 4
97. 9.591 9.591 ↑ 1.0 1 3,197

Index Scan using idx_b43ad1b71645dea9 on claire_branch cb (cost=0.29..0.31 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=3,197)

  • Index Cond: (reference_id = cfch_6.reference_id)
  • Filter: (status = 'published'::branch_status)
  • Rows Removed by Filter: 1
98. 9.438 9.438 ↑ 1.0 1 3,146

Index Scan using claire_reference_pkey on claire_reference cr (cost=0.43..0.47 rows=1 width=30) (actual time=0.003..0.003 rows=1 loops=3,146)

  • Index Cond: (id = cfch_6.reference_id)
99. 125.840 125.840 ↓ 3.0 3 3,146

Index Scan using idx_d310fdd9a76ed395 on claire_completed_part ccp (cost=0.44..21.14 rows=1 width=16) (actual time=0.030..0.040 rows=3 loops=3,146)

  • Index Cond: (user_id = cfch_6.user_id)
  • Filter: (cfch_6.reference_id = reference_course_id)
  • Rows Removed by Filter: 106
100. 180.826 180.826 ↓ 2.5 251 7,862

CTE Scan on with_users with_users_7 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.023 rows=251 loops=7,862)

101. 15.724 15.724 ↑ 1.0 1 7,862

Index Scan using claire_element_pkey on claire_element ce (cost=0.43..8.34 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=7,862)

  • Index Cond: (id = cb.root_element_id)
102.          

CTE with_last_followed_courses

103. 0.206 157.740 ↓ 215.0 215 1

Subquery Scan on sub_1 (cost=5,489.27..5,489.30 rows=1 width=90) (actual time=155.996..157.740 rows=215 loops=1)

  • Filter: (sub_1.rank = 1)
  • Rows Removed by Filter: 2,931
104. 1.289 157.534 ↓ 3,146.0 3,146 1

WindowAgg (cost=5,489.27..5,489.29 rows=1 width=90) (actual time=155.993..157.534 rows=3,146 loops=1)

105. 1.882 156.245 ↓ 3,146.0 3,146 1

Sort (cost=5,489.27..5,489.27 rows=1 width=82) (actual time=155.987..156.245 rows=3,146 loops=1)

  • Sort Key: with_users_8.user_id, cfch_7.followed_at DESC
  • Sort Method: quicksort Memory: 636kB
106. 2.645 154.363 ↓ 3,146.0 3,146 1

Nested Loop (cost=1.59..5,489.26 rows=1 width=82) (actual time=0.063..154.363 rows=3,146 loops=1)

107. 58.998 145.426 ↓ 3,146.0 3,146 1

Nested Loop (cost=1.15..5,480.91 rows=1 width=46) (actual time=0.057..145.426 rows=3,146 loops=1)

  • Join Filter: (cfch_7.user_id = with_users_8.user_id)
  • Rows Removed by Join Filter: 786,500
108. 2.253 20.362 ↓ 3,146.0 3,146 1

Nested Loop (cost=1.15..5,477.66 rows=1 width=50) (actual time=0.028..20.362 rows=3,146 loops=1)

109. 1.511 11.817 ↓ 209.7 3,146 1

Nested Loop (cost=0.72..5,470.51 rows=15 width=28) (actual time=0.022..11.817 rows=3,146 loops=1)

110. 0.614 3.912 ↓ 14.4 3,197 1

Nested Loop (cost=0.43..5,400.00 rows=222 width=20) (actual time=0.015..3.912 rows=3,197 loops=1)

111. 0.035 0.035 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_8 (cost=0.00..2.00 rows=100 width=20) (actual time=0.000..0.035 rows=251 loops=1)

112. 3.263 3.263 ↓ 6.5 13 251

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_7 (cost=0.43..53.96 rows=2 width=16) (actual time=0.004..0.013 rows=13 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_8.user_id)
  • Filter: ((followed_at >= with_user_periods_inside_team_8.team_joining_date) AND (followed_at <= COALESCE(with_user_periods_inside_team_8.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 4
113. 6.394 6.394 ↑ 1.0 1 3,197

Index Scan using idx_b43ad1b71645dea9 on claire_branch cb_1 (cost=0.29..0.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=3,197)

  • Index Cond: (reference_id = cfch_7.reference_id)
  • Filter: (status = 'published'::branch_status)
  • Rows Removed by Filter: 1
114. 6.292 6.292 ↑ 1.0 1 3,146

Index Scan using claire_reference_pkey on claire_reference cr_1 (cost=0.43..0.47 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=3,146)

  • Index Cond: (id = cfch_7.reference_id)
115. 66.066 66.066 ↓ 2.5 251 3,146

CTE Scan on with_users with_users_8 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.021 rows=251 loops=3,146)

116. 6.292 6.292 ↑ 1.0 1 3,146

Index Scan using claire_element_pkey on claire_element ce_1 (cost=0.43..8.34 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=3,146)

  • Index Cond: (id = cb_1.root_element_id)
117.          

CTE with_last_completed_courses_from_single_page_courses

118. 0.018 9.625 ↓ 68.0 68 1

Unique (cost=1,395.42..1,395.44 rows=1 width=90) (actual time=9.606..9.625 rows=68 loops=1)

119. 0.029 9.607 ↓ 72.0 72 1

Sort (cost=1,395.42..1,395.42 rows=1 width=90) (actual time=9.606..9.607 rows=72 loops=1)

  • Sort Key: sub_2.user_id, sub_2.title, sub_2.slug, sub_2.date, sub_2.reference_id
  • Sort Method: quicksort Memory: 40kB
120. 0.022 9.578 ↓ 72.0 72 1

Subquery Scan on sub_2 (cost=1,395.37..1,395.41 rows=1 width=90) (actual time=9.483..9.578 rows=72 loops=1)

  • Filter: (sub_2.rank = 1)
  • Rows Removed by Filter: 82
121. 0.067 9.556 ↓ 154.0 154 1

WindowAgg (cost=1,395.37..1,395.40 rows=1 width=90) (actual time=9.478..9.556 rows=154 loops=1)

122. 0.096 9.489 ↓ 154.0 154 1

Sort (cost=1,395.37..1,395.38 rows=1 width=82) (actual time=9.472..9.489 rows=154 loops=1)

  • Sort Key: with_users_9.user_id, ccc_2.completed_at DESC
  • Sort Method: quicksort Memory: 53kB
123. 0.100 9.393 ↓ 154.0 154 1

Nested Loop (cost=2.01..1,395.36 rows=1 width=82) (actual time=0.063..9.393 rows=154 loops=1)

124. 2.590 8.985 ↓ 154.0 154 1

Nested Loop (cost=1.58..1,387.02 rows=1 width=46) (actual time=0.057..8.985 rows=154 loops=1)

  • Join Filter: (ccc_2.user_id = with_users_9.user_id)
  • Rows Removed by Join Filter: 38,500
125. 0.040 3.469 ↓ 154.0 154 1

Nested Loop (cost=1.58..1,383.77 rows=1 width=54) (actual time=0.038..3.469 rows=154 loops=1)

  • Join Filter: ((cfch_8.followed_at >= with_user_periods_inside_team_9.team_joining_date) AND (cfch_8.followed_at <= COALESCE(with_user_periods_inside_team_9.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 1
126. 0.047 1.254 ↓ 145.0 145 1

Nested Loop (cost=1.14..1,380.99 rows=1 width=74) (actual time=0.026..1.254 rows=145 loops=1)

127. 0.080 0.917 ↓ 72.5 145 1

Nested Loop (cost=0.71..1,378.45 rows=2 width=44) (actual time=0.020..0.917 rows=145 loops=1)

128. 0.024 0.547 ↓ 4.8 145 1

Nested Loop (cost=0.42..1,368.73 rows=30 width=36) (actual time=0.014..0.547 rows=145 loops=1)

129. 0.021 0.021 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_9 (cost=0.00..2.00 rows=100 width=20) (actual time=0.001..0.021 rows=251 loops=1)

130. 0.502 0.502 ↑ 1.0 1 251

Index Scan using idx_48cd04a5a76ed395 on claire_completed_course ccc_2 (cost=0.42..13.66 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_9.user_id)
  • Filter: ((completed_at IS NOT NULL) AND (completed_at >= with_user_periods_inside_team_9.team_joining_date) AND (completed_at <= COALESCE(with_user_periods_inside_team_9.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 0
131. 0.290 0.290 ↑ 1.0 1 145

Index Scan using idx_b43ad1b71645dea9 on claire_branch cb_2 (cost=0.29..0.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=145)

  • Index Cond: (reference_id = ccc_2.reference_course_id)
  • Filter: (status = 'published'::branch_status)
  • Rows Removed by Filter: 1
132. 0.290 0.290 ↑ 1.0 1 145

Index Scan using claire_reference_pkey on claire_reference cr_2 (cost=0.43..1.26 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=145)

  • Index Cond: (id = ccc_2.reference_course_id)
133. 2.175 2.175 ↑ 1.0 1 145

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_8 (cost=0.43..2.76 rows=1 width=16) (actual time=0.009..0.015 rows=1 loops=145)

  • Index Cond: (user_id = ccc_2.user_id)
  • Filter: (ccc_2.reference_course_id = reference_id)
  • Rows Removed by Filter: 39
134. 2.926 2.926 ↓ 2.5 251 154

CTE Scan on with_users with_users_9 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.019 rows=251 loops=154)

135. 0.308 0.308 ↑ 1.0 1 154

Index Scan using claire_element_pkey on claire_element ce_2 (cost=0.43..8.34 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=154)

  • Index Cond: (id = cb_2.root_element_id)
136.          

CTE with_last_completed_courses_from_multiple_page_courses

137. 0.002 65.171 ↑ 1.0 1 1

Unique (cost=5,306.27..5,306.29 rows=1 width=90) (actual time=65.171..65.171 rows=1 loops=1)

138. 0.014 65.169 ↑ 1.0 1 1

Sort (cost=5,306.27..5,306.27 rows=1 width=90) (actual time=65.169..65.169 rows=1 loops=1)

  • Sort Key: sub_3.user_id, sub_3.title, sub_3.slug, sub_3.date, sub_3.reference_id
  • Sort Method: quicksort Memory: 25kB
139. 0.058 65.155 ↑ 1.0 1 1

Subquery Scan on sub_3 (cost=5,306.23..5,306.26 rows=1 width=90) (actual time=64.624..65.155 rows=1 loops=1)

  • Filter: (sub_3.rank = 1)
  • Rows Removed by Filter: 1,145
140. 0.379 65.097 ↓ 1,146.0 1,146 1

WindowAgg (cost=5,306.23..5,306.25 rows=1 width=90) (actual time=64.622..65.097 rows=1,146 loops=1)

141. 0.655 64.718 ↓ 1,146.0 1,146 1

Sort (cost=5,306.23..5,306.23 rows=1 width=82) (actual time=64.616..64.718 rows=1,146 loops=1)

  • Sort Key: cucr_2.created_at DESC
  • Sort Method: quicksort Memory: 229kB
142. 0.247 64.063 ↓ 1,146.0 1,146 1

Nested Loop (cost=2.02..5,306.22 rows=1 width=82) (actual time=0.055..64.063 rows=1,146 loops=1)

143. 18.960 61.524 ↓ 1,146.0 1,146 1

Nested Loop (cost=1.58..5,297.87 rows=1 width=46) (actual time=0.051..61.524 rows=1,146 loops=1)

  • Join Filter: (cucr_2.user_id = with_users_10.user_id)
  • Rows Removed by Join Filter: 286,500
144. 0.000 21.936 ↓ 1,146.0 1,146 1

Nested Loop (cost=1.58..5,294.62 rows=1 width=54) (actual time=0.030..21.936 rows=1,146 loops=1)

  • Join Filter: ((cfch_9.followed_at >= with_user_periods_inside_team_10.team_joining_date) AND (cfch_9.followed_at <= COALESCE(with_user_periods_inside_team_10.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Join Filter: 112
145. 0.230 6.523 ↓ 1,187.0 1,187 1

Nested Loop (cost=1.15..5,293.58 rows=1 width=74) (actual time=0.021..6.523 rows=1,187 loops=1)

146. 0.109 3.919 ↓ 98.9 1,187 1

Nested Loop (cost=0.72..5,287.13 rows=12 width=44) (actual time=0.015..3.919 rows=1,187 loops=1)

147. 0.108 1.402 ↓ 6.7 1,204 1

Nested Loop (cost=0.43..5,230.19 rows=179 width=36) (actual time=0.010..1.402 rows=1,204 loops=1)

148. 0.039 0.039 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_10 (cost=0.00..2.00 rows=100 width=20) (actual time=0.001..0.039 rows=251 loops=1)

149. 1.255 1.255 ↓ 2.5 5 251

Index Scan using idx_2553bf7aa76ed395 on claire_user_course_result cucr_2 (cost=0.43..52.26 rows=2 width=16) (actual time=0.002..0.005 rows=5 loops=251)

  • Index Cond: (user_id = with_user_periods_inside_team_10.user_id)
  • Filter: ((created_at >= with_user_periods_inside_team_10.team_joining_date) AND (created_at <= COALESCE(with_user_periods_inside_team_10.team_leaving_date, 'infinity'::timestamp without time zone)))
  • Rows Removed by Filter: 1
150. 2.408 2.408 ↑ 1.0 1 1,204

Index Scan using idx_b43ad1b71645dea9 on claire_branch cb_3 (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.002 rows=1 loops=1,204)

  • Index Cond: (reference_id = cucr_2.reference_id)
  • Filter: (status = 'published'::branch_status)
  • Rows Removed by Filter: 1
151. 2.374 2.374 ↑ 1.0 1 1,187

Index Scan using claire_reference_pkey on claire_reference cr_3 (cost=0.43..0.53 rows=1 width=30) (actual time=0.002..0.002 rows=1 loops=1,187)

  • Index Cond: (id = cucr_2.reference_id)
152. 15.431 15.431 ↑ 1.0 1 1,187

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_9 (cost=0.43..1.02 rows=1 width=16) (actual time=0.008..0.013 rows=1 loops=1,187)

  • Index Cond: (user_id = cucr_2.user_id)
  • Filter: (cucr_2.reference_id = reference_id)
  • Rows Removed by Filter: 40
153. 20.628 20.628 ↓ 2.5 251 1,146

CTE Scan on with_users with_users_10 (cost=0.00..2.00 rows=100 width=4) (actual time=0.000..0.018 rows=251 loops=1,146)

154. 2.292 2.292 ↑ 1.0 1 1,146

Index Scan using claire_element_pkey on claire_element ce_3 (cost=0.43..8.34 rows=1 width=44) (actual time=0.002..0.002 rows=1 loops=1,146)

  • Index Cond: (id = cb_3.root_element_id)
155.          

CTE with_last_completed_exercise_sessions

156. 0.000 0.780 ↓ 0.0 0 1

Unique (cost=528.26..528.27 rows=1 width=90) (actual time=0.780..0.780 rows=0 loops=1)

157. 0.011 0.780 ↓ 0.0 0 1

Sort (cost=528.26..528.26 rows=1 width=90) (actual time=0.780..0.780 rows=0 loops=1)

  • Sort Key: sub_4.user_id, sub_4.date, sub_4.title, sub_4.slug, sub_4.reference_id
  • Sort Method: quicksort Memory: 25kB
158. 0.000 0.769 ↓ 0.0 0 1

Subquery Scan on sub_4 (cost=528.19..528.25 rows=1 width=90) (actual time=0.769..0.769 rows=0 loops=1)

  • Filter: (sub_4.rank = 1)
159. 0.002 0.769 ↓ 0.0 0 1

WindowAgg (cost=528.19..528.22 rows=2 width=90) (actual time=0.769..0.769 rows=0 loops=1)

160. 0.007 0.767 ↓ 0.0 0 1

Sort (cost=528.19..528.19 rows=2 width=82) (actual time=0.767..0.767 rows=0 loops=1)

  • Sort Key: ces.completed_at DESC
  • Sort Method: quicksort Memory: 25kB
161. 0.001 0.760 ↓ 0.0 0 1

Nested Loop (cost=5.27..528.18 rows=2 width=82) (actual time=0.760..0.760 rows=0 loops=1)

  • Join Filter: ((cfch_10.followed_at >= with_user_periods_inside_team_11.team_joining_date) AND (cfch_10.followed_at <= COALESCE(with_user_periods_inside_team_11.team_leaving_date, 'infinity'::timestamp without time zone)) AND (ce_4.reference_course_id = cfch_10.user_id))
162. 0.000 0.759 ↓ 0.0 0 1

Nested Loop (cost=4.84..526.96 rows=1 width=114) (actual time=0.759..0.759 rows=0 loops=1)

  • Join Filter: (ce_4.reference_course_id = cr_4.id)
163. 0.001 0.759 ↓ 0.0 0 1

Nested Loop (cost=4.41..526.47 rows=1 width=84) (actual time=0.759..0.759 rows=0 loops=1)

164. 0.002 0.758 ↓ 0.0 0 1

Nested Loop (cost=3.97..518.12 rows=1 width=48) (actual time=0.758..0.758 rows=0 loops=1)

  • Join Filter: (ce_4.reference_course_id = with_users_11.user_id)
165. 0.000 0.756 ↓ 0.0 0 1

Nested Loop (cost=3.97..514.87 rows=1 width=44) (actual time=0.756..0.756 rows=0 loops=1)

  • Join Filter: ((ces.completed_at >= with_user_periods_inside_team_11.team_joining_date) AND (ces.completed_at <= COALESCE(with_user_periods_inside_team_11.team_leaving_date, 'infinity'::timestamp without time zone)) AND (ces.created_at >= with_user_periods_inside_team_11.team_joining_date) AND (ces.created_at <= COALESCE(with_user_periods_inside_team_11.team_leaving_date, 'infinity'::timestamp without time zone)))
166. 0.001 0.756 ↓ 0.0 0 1

Nested Loop (cost=3.54..377.79 rows=17 width=36) (actual time=0.756..0.756 rows=0 loops=1)

167. 0.369 0.755 ↓ 0.0 0 1

Hash Join (cost=3.25..162.11 rows=278 width=28) (actual time=0.755..0.755 rows=0 loops=1)

  • Hash Cond: (ce_4.reference_course_id = with_user_periods_inside_team_11.user_id)
168. 0.334 0.334 ↑ 1.0 2,915 1

Seq Scan on claire_exercise ce_4 (cost=0.00..145.15 rows=2,915 width=8) (actual time=0.015..0.334 rows=2,915 loops=1)

169. 0.034 0.052 ↓ 2.5 251 1

Hash (cost=2.00..2.00 rows=100 width=20) (actual time=0.052..0.052 rows=251 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 20kB
170. 0.018 0.018 ↓ 2.5 251 1

CTE Scan on with_user_periods_inside_team with_user_periods_inside_team_11 (cost=0.00..2.00 rows=100 width=20) (actual time=0.000..0.018 rows=251 loops=1)

171. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_b43ad1b71645dea9 on claire_branch cb_4 (cost=0.29..0.77 rows=1 width=8) (never executed)

  • Index Cond: (reference_id = ce_4.reference_course_id)
  • Filter: (status = 'published'::branch_status)
172. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_ea265263a76ed395e934951a on claire_exercise_session ces (cost=0.43..8.04 rows=1 width=24) (never executed)

  • Index Cond: ((user_id = ce_4.reference_course_id) AND (exercise_id = ce_4.id))
  • Filter: (completed_at IS NOT NULL)
173. 0.000 0.000 ↓ 0.0 0

CTE Scan on with_users with_users_11 (cost=0.00..2.00 rows=100 width=4) (never executed)

174. 0.000 0.000 ↓ 0.0 0

Index Scan using claire_element_pkey on claire_element c (cost=0.43..8.34 rows=1 width=44) (never executed)

  • Index Cond: (id = cb_4.root_element_id)
175. 0.000 0.000 ↓ 0.0 0

Index Scan using claire_reference_pkey on claire_reference cr_4 (cost=0.43..0.48 rows=1 width=30) (never executed)

  • Index Cond: (id = ces.user_id)
176. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_85edda85a76ed395 on claire_followed_course_history cfch_10 (cost=0.43..0.87 rows=20 width=12) (never executed)

  • Index Cond: (user_id = ces.user_id)
177. 0.158 1,063.285 ↓ 1.4 140 1

Sort (cost=24.93..25.18 rows=100 width=268) (actual time=1,063.274..1,063.285 rows=140 loops=1)

  • Sort Key: (GREATEST(wlfp.date, wlcc.date, wlces.date, wlfc.date, wlccfspc.date, wlccfmpc.date, u.last_activity)) DESC
  • Sort Method: quicksort Memory: 112kB
178. 0.211 1,063.127 ↓ 2.5 251 1

Hash Left Join (cost=9.07..21.61 rows=100 width=268) (actual time=1,062.424..1,063.127 rows=251 loops=1)

  • Hash Cond: (u.user_id = wlccfmpc.user_id)
179. 0.049 997.732 ↓ 2.5 251 1

Hash Left Join (cost=9.03..17.19 rows=100 width=4,388) (actual time=997.221..997.732 rows=251 loops=1)

  • Hash Cond: (u.user_id = wlccfspc.user_id)
180. 0.084 988.008 ↓ 2.5 251 1

Hash Left Join (cost=9.00..16.77 rows=100 width=3,344) (actual time=987.533..988.008 rows=251 loops=1)

  • Hash Cond: (u.user_id = wlfc.user_id)
181. 0.057 830.035 ↓ 2.5 251 1

Hash Left Join (cost=8.97..16.35 rows=100 width=2,300) (actual time=829.630..830.035 rows=251 loops=1)

  • Hash Cond: (u.user_id = wlces.user_id)
182. 0.075 829.196 ↓ 2.5 251 1

Hash Left Join (cost=8.94..15.94 rows=100 width=1,256) (actual time=828.833..829.196 rows=251 loops=1)

  • Hash Cond: (u.user_id = wlcc.user_id)
183. 0.064 303.559 ↓ 2.5 251 1

Hash Left Join (cost=8.90..15.52 rows=100 width=212) (actual time=303.257..303.559 rows=251 loops=1)

  • Hash Cond: (u.user_id = wlfp.user_id)
184. 0.066 285.677 ↓ 2.5 251 1

Hash Left Join (cost=6.76..12.34 rows=100 width=204) (actual time=285.432..285.677 rows=251 loops=1)

  • Hash Cond: (u.user_id = wnosc.user_id)
185. 0.061 279.483 ↓ 2.5 251 1

Hash Left Join (cost=3.51..7.71 rows=100 width=196) (actual time=279.287..279.483 rows=251 loops=1)

  • Hash Cond: (u.user_id = wnolh.user_id)
186. 0.053 276.360 ↓ 2.5 251 1

Hash Left Join (cost=3.38..7.17 rows=100 width=188) (actual time=276.216..276.360 rows=251 loops=1)

  • Hash Cond: (u.user_id = wnocc.user_id)
187. 0.089 194.968 ↓ 2.5 251 1

Hash Left Join (cost=3.25..6.62 rows=100 width=180) (actual time=194.858..194.968 rows=251 loops=1)

  • Hash Cond: (u.user_id = wnofc.user_id)
188. 0.943 0.943 ↓ 2.5 251 1

CTE Scan on with_users u (cost=0.00..2.00 rows=100 width=172) (actual time=0.912..0.943 rows=251 loops=1)

189. 0.127 193.936 ↓ 2.0 201 1

Hash (cost=2.00..2.00 rows=100 width=12) (actual time=193.936..193.936 rows=201 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
190. 193.809 193.809 ↓ 2.0 201 1

CTE Scan on with_number_of_followed_courses wnofc (cost=0.00..2.00 rows=100 width=12) (actual time=67.719..193.809 rows=201 loops=1)

191. 0.064 81.339 ↓ 38.5 154 1

Hash (cost=0.08..0.08 rows=4 width=12) (actual time=81.339..81.339 rows=154 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
192. 81.275 81.275 ↓ 38.5 154 1

CTE Scan on with_number_of_course_completed wnocc (cost=0.00..0.08 rows=4 width=12) (actual time=80.665..81.275 rows=154 loops=1)

193. 0.046 3.062 ↓ 38.5 154 1

Hash (cost=0.08..0.08 rows=4 width=12) (actual time=3.062..3.062 rows=154 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
194. 3.016 3.016 ↓ 38.5 154 1

CTE Scan on with_number_of_learning_hours wnolh (cost=0.00..0.08 rows=4 width=12) (actual time=2.026..3.016 rows=154 loops=1)

195. 0.074 6.128 ↓ 2.1 215 1

Hash (cost=2.00..2.00 rows=100 width=12) (actual time=6.128..6.128 rows=215 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
196. 6.054 6.054 ↓ 2.1 215 1

CTE Scan on with_number_of_started_courses wnosc (cost=0.00..2.00 rows=100 width=12) (actual time=0.230..6.054 rows=215 loops=1)

197. 0.083 17.818 ↓ 1.9 123 1

Hash (cost=1.32..1.32 rows=66 width=12) (actual time=17.818..17.818 rows=123 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
198. 17.735 17.735 ↓ 1.9 123 1

CTE Scan on with_last_followed_project wlfp (cost=0.00..1.32 rows=66 width=12) (actual time=17.347..17.735 rows=123 loops=1)

199. 0.058 525.562 ↓ 178.0 178 1

Hash (cost=0.02..0.02 rows=1 width=1,048) (actual time=525.562..525.562 rows=178 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 30kB
200. 525.504 525.504 ↓ 178.0 178 1

CTE Scan on with_last_completed_chapter wlcc (cost=0.00..0.02 rows=1 width=1,048) (actual time=525.379..525.504 rows=178 loops=1)

201. 0.001 0.782 ↓ 0.0 0 1

Hash (cost=0.02..0.02 rows=1 width=1,048) (actual time=0.782..0.782 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
202. 0.781 0.781 ↓ 0.0 0 1

CTE Scan on with_last_completed_exercise_sessions wlces (cost=0.00..0.02 rows=1 width=1,048) (actual time=0.781..0.781 rows=0 loops=1)

203. 0.052 157.889 ↓ 215.0 215 1

Hash (cost=0.02..0.02 rows=1 width=1,048) (actual time=157.889..157.889 rows=215 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 35kB
204. 157.837 157.837 ↓ 215.0 215 1

CTE Scan on with_last_followed_courses wlfc (cost=0.00..0.02 rows=1 width=1,048) (actual time=155.997..157.837 rows=215 loops=1)

205. 0.030 9.675 ↓ 68.0 68 1

Hash (cost=0.02..0.02 rows=1 width=1,048) (actual time=9.675..9.675 rows=68 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 17kB
206. 9.645 9.645 ↓ 68.0 68 1

CTE Scan on with_last_completed_courses_from_single_page_courses wlccfspc (cost=0.00..0.02 rows=1 width=1,048) (actual time=9.608..9.645 rows=68 loops=1)

207. 0.012 65.184 ↑ 1.0 1 1

Hash (cost=0.02..0.02 rows=1 width=1,048) (actual time=65.184..65.184 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
208. 65.172 65.172 ↑ 1.0 1 1

CTE Scan on with_last_completed_courses_from_multiple_page_courses wlccfmpc (cost=0.00..0.02 rows=1 width=1,048) (actual time=65.172..65.172 rows=1 loops=1)

Planning time : 38.089 ms
Execution time : 1,064.560 ms