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 51152.302 ↓ 2044.0 2044 1

HashAggregate (cost=3997.38..3997.39 rows=1 width=32) (actual time=51150.830..51152.302 rows=2044 loops=1)

  • Filter: ((sum(sud.statsreads) > 0::numeric) OR (sum(sud.statswrites) > 0::numeric))
2. 219.933 50959.580 ↓ 41652.0 41652 1

Nested Loop (cost=3993.31..3997.36 rows=1 width=32) (actual time=19691.758..50959.580 rows=41652 loops=1)

3. 348.174 19803.722 ↓ 137493.0 137493 1

HashAggregate (cost=3978.18..3978.19 rows=1 width=24) (actual time=19691.335..19803.722 rows=137493 loops=1)

4. 8738.863 19455.548 ↓ 265605.0 265605 1

Merge Join (cost=1.08..3978.17 rows=1 width=24) (actual time=0.126..19455.548 rows=265605 loops=1)

  • Merge Cond: (c.instanceid = e.courseid)
  • Join Filter: (ue.enrolid = e.id)
5. 426.263 2214.833 ↓ 148.4 1538383 1

Nested Loop (cost=0.00..37409.02 rows=10365 width=32) (actual time=0.097..2214.833 rows=1538383 loops=1)

6. 34.405 260.580 ↓ 136.3 152799 1

Nested Loop (cost=0.00..36908.69 rows=1121 width=24) (actual time=0.086..260.580 rows=152799 loops=1)

7. 38.325 38.325 ↓ 1.0 7514 1

Index Scan using mdl_cont_conins_uix on mdl_context c (cost=0.00..16979.79 rows=7332 width=16) (actual time=0.044..38.325 rows=7514 loops=1)

  • Index Cond: (contextlevel = 50)
8. 187.850 187.850 ↑ 1.6 20 7514

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=7514)

  • Index Cond: (contextid = c.id)
  • Filter: ((roleid <> 6) AND (userid <> 1))
9. 1527.990 1527.990 ↓ 2.5 10 152799

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=152799)

  • Index Cond: (userid = ra.userid)
10. 8501.852 8501.852 ↓ 1272.9 34010199 1

Index Scan using mdl_enro_cou_ix on mdl_enrol e (cost=0.00..2811.76 rows=26719 width=16) (actual time=0.007..8501.852 rows=34010199 loops=1)

11. 2612.367 30935.925 ↓ 0.0 0 137493

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=137493)

  • Recheck Cond: ((userid = ra.userid) AND (courseid = e.courseid))
  • Filter: ((timeend = 1331042400) AND ((stattype)::text = 'activity'::text))
12. 787.670 28323.558 ↓ 0.0 0 137493

BitmapAnd (cost=15.13..15.13 rows=1 width=0) (actual time=0.206..0.206 rows=0 loops=137493)

13. 2199.888 2199.888 ↓ 1.8 44 137493

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=137493)

  • Index Cond: (userid = ra.userid)
14. 25336.000 25336.000 ↓ 5.4 1373 126680

Bitmap Index Scan on mdl_statuserdail_cou_ix (cost=0.00..10.29 rows=252 width=0) (actual time=0.200..0.200 rows=1373 loops=126680)

  • Index Cond: (courseid = e.courseid)