explain.depesz.com

A tool for finding a real cause for slow queries.

Result: rhr

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 192.722 51,152.302 ↓ 2,044.0 2,044 1

HashAggregate (cost=3,997.38..3,997.39 rows=1 width=32) (actual time=51,150.830..51,152.302 rows=2,044 loops=1)

  • Filter: ((sum(sud.statsreads) > 0::numeric) OR (sum(sud.statswrites) > 0::numeric))
2. 219.933 50,959.580 ↓ 41,652.0 41,652 1

Nested Loop (cost=3,993.31..3,997.36 rows=1 width=32) (actual time=19,691.758..50,959.580 rows=41,652 loops=1)

3. 348.174 19,803.722 ↓ 137,493.0 137,493 1

HashAggregate (cost=3,978.18..3,978.19 rows=1 width=24) (actual time=19,691.335..19,803.722 rows=137,493 loops=1)

4. 8,738.863 19,455.548 ↓ 265,605.0 265,605 1

Merge Join (cost=1.08..3,978.17 rows=1 width=24) (actual time=0.126..19,455.548 rows=265,605 loops=1)

  • Merge Cond: (c.instanceid = e.courseid)
  • Join Filter: (ue.enrolid = e.id)
5. 426.263 2,214.833 ↓ 148.4 1,538,383 1

Nested Loop (cost=0.00..37,409.02 rows=10,365 width=32) (actual time=0.097..2,214.833 rows=1,538,383 loops=1)

6. 34.405 260.580 ↓ 136.3 152,799 1

Nested Loop (cost=0.00..36,908.69 rows=1,121 width=24) (actual time=0.086..260.580 rows=152,799 loops=1)

7. 38.325 38.325 ↓ 1.0 7,514 1

Index Scan using mdl_cont_conins_uix on mdl_context c (cost=0.00..16,979.79 rows=7,332 width=16) (actual time=0.044..38.325 rows=7,514 loops=1)

  • Index Cond: (contextlevel = 50)
8. 187.850 187.850 ↑ 1.6 20 7,514

Index Scan using mdl_roleassi_con_ix on mdl_role_assignments ra (cost=0.00..2.32 rows=32 width=24) (actual time=0.004..0.025 rows=20 loops=7,514)

  • Index Cond: (contextid = c.id)
  • Filter: ((roleid <> 6) AND (userid <> 1))
9. 1,527.990 1,527.990 ↓ 2.5 10 152,799

Index Scan using mdl_userenro_use_ix on mdl_user_enrolments ue (cost=0.00..0.40 rows=4 width=16) (actual time=0.004..0.010 rows=10 loops=152,799)

  • Index Cond: (userid = ra.userid)
10. 8,501.852 8,501.852 ↓ 1,272.9 34,010,199 1

Index Scan using mdl_enro_cou_ix on mdl_enrol e (cost=0.00..2,811.76 rows=26,719 width=16) (actual time=0.007..8,501.852 rows=34,010,199 loops=1)

11. 2,612.367 30,935.925 ↓ 0.0 0 137,493

Bitmap Heap Scan on mdl_stats_user_daily sud (cost=15.13..19.14 rows=1 width=32) (actual time=0.225..0.225 rows=0 loops=137,493)

  • Recheck Cond: ((userid = ra.userid) AND (courseid = e.courseid))
  • Filter: ((timeend = 1331042400) AND ((stattype)::text = 'activity'::text))
12. 787.670 28,323.558 ↓ 0.0 0 137,493

BitmapAnd (cost=15.13..15.13 rows=1 width=0) (actual time=0.206..0.206 rows=0 loops=137,493)

13. 2,199.888 2,199.888 ↓ 1.8 44 137,493

Bitmap Index Scan on mdl_statuserdail_use_ix (cost=0.00..4.58 rows=24 width=0) (actual time=0.016..0.016 rows=44 loops=137,493)

  • Index Cond: (userid = ra.userid)
14. 25,336.000 25,336.000 ↓ 5.4 1,373 126,680

Bitmap Index Scan on mdl_statuserdail_cou_ix (cost=0.00..10.29 rows=252 width=0) (actual time=0.200..0.200 rows=1,373 loops=126,680)

  • Index Cond: (courseid = e.courseid)