explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GUS3

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 570,959.676 ↓ 40.2 925 1

Nested Loop Left Join (cost=155,226.66..155,450.99 rows=23 width=361) (actual time=570,957.086..570,959.676 rows=925 loops=1)

2. 0.000 570,957.985 ↓ 40.2 925 1

Nested Loop Left Join (cost=155,226.24..155,256.87 rows=23 width=305) (actual time=570,957.049..570,957.985 rows=925 loops=1)

3. 0.474 570,957.265 ↓ 40.2 925 1

Merge Left Join (cost=155,225.96..155,249.87 rows=23 width=287) (actual time=570,957.020..570,957.265 rows=925 loops=1)

  • Merge Cond: (cm.instance = q.id)
4. 0.989 570,708.128 ↓ 40.2 925 1

Sort (cost=154,556.76..154,556.81 rows=23 width=252) (actual time=570,708.038..570,708.128 rows=925 loops=1)

  • Sort Key: cm.instance
  • Sort Method: quicksort Memory: 208kB
5. 0.127 570,707.139 ↓ 40.2 925 1

Nested Loop Left Join (cost=154,322.05..154,556.24 rows=23 width=252) (actual time=568,982.399..570,707.139 rows=925 loops=1)

6. 0.794 570,599.712 ↓ 40.2 925 1

Nested Loop Left Join (cost=154,321.76..154,548.82 rows=23 width=229) (actual time=568,982.354..570,599.712 rows=925 loops=1)

7. 0.122 570,547.118 ↓ 40.2 925 1

Nested Loop Left Join (cost=154,321.47..154,541.30 rows=23 width=195) (actual time=568,982.338..570,547.118 rows=925 loops=1)

8. 0.828 570,475.771 ↓ 40.2 925 1

Nested Loop Left Join (cost=154,321.19..154,533.72 rows=23 width=159) (actual time=568,982.308..570,475.771 rows=925 loops=1)

9. 0.419 569,085.593 ↓ 40.2 925 1

Nested Loop Left Join (cost=154,320.90..154,526.33 rows=23 width=121) (actual time=568,981.296..569,085.593 rows=925 loops=1)

10. 0.447 569,072.224 ↓ 40.2 925 1

Hash Left Join (cost=154,320.47..154,514.93 rows=23 width=90) (actual time=568,971.913..569,072.224 rows=925 loops=1)

  • Hash Cond: (cm.module = m.id)
11. 0.926 569,071.746 ↓ 40.2 925 1

Nested Loop Left Join (cost=154,318.71..154,513.10 rows=23 width=40) (actual time=568,971.852..569,071.746 rows=925 loops=1)

12. 0.687 568,972.770 ↓ 40.2 925 1

GroupAggregate (cost=154,318.29..154,318.75 rows=23 width=24) (actual time=568,971.803..568,972.770 rows=925 loops=1)

  • Group Key: cm_1.id, log.userid
13. 3.636 568,972.083 ↓ 85.5 1,966 1

Sort (cost=154,318.29..154,318.34 rows=23 width=16) (actual time=568,971.791..568,972.083 rows=1,966 loops=1)

  • Sort Key: cm_1.id, log.userid
  • Sort Method: quicksort Memory: 141kB
14. 38.679 568,968.447 ↓ 85.5 1,966 1

Hash Right Join (cost=173.12..154,317.77 rows=23 width=16) (actual time=34,470.406..568,968.447 rows=1,966 loops=1)

  • Hash Cond: (log.contextinstanceid = cm_1.id)
15. 568,928.143 568,928.143 ↓ 2.8 30,897 1

Index Scan using mdl_logsstanlog_useconconcr_ix on mdl_logstore_standard_log log (cost=0.70..154,116.65 rows=10,933 width=16) (actual time=8,852.077..568,928.143 rows=30,897 loops=1)

  • Index Cond: ((userid = ANY ('{244968,192145,157721,189175,191238,188739,181114,177014,182920,191254,191224,191613,180391,197398,188594,164309,154828,192088,181182,186345,181203,187061,183150,123338,181208,189615,183104,197397,191609,180593,191364,191397,155186}'::bigint[])) AND (timecreated >= 1551063600))
  • Filter: ((action)::text = 'viewed'::text)
  • Rows Removed by Filter: 53188
16. 0.021 1.625 ↓ 3.9 89 1

Hash (cost=172.13..172.13 rows=23 width=8) (actual time=1.625..1.625 rows=89 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
17. 1.604 1.604 ↓ 3.9 89 1

Index Scan using mdl_courmodu_cou_ix on mdl_course_modules cm_1 (cost=0.42..172.13 rows=23 width=8) (actual time=0.082..1.604 rows=89 loops=1)

  • Index Cond: (course = 54326)
  • Filter: ((visible = 1) AND ((module = 13) OR (module = 26) OR (module = 25) OR (module = 33) OR (module = 5) OR (module = 12) OR (module = 23)))
  • Rows Removed by Filter: 155
18. 98.050 98.050 ↑ 1.0 1 925

Index Scan using mdl_courmodu_id_pk on mdl_course_modules cm (cost=0.42..8.44 rows=1 width=24) (actual time=0.106..0.106 rows=1 loops=925)

  • Index Cond: (cm_1.id = id)
19. 0.011 0.031 ↑ 1.0 34 1

Hash (cost=1.34..1.34 rows=34 width=66) (actual time=0.031..0.031 rows=34 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
20. 0.020 0.020 ↑ 1.0 34 1

Seq Scan on mdl_modules m (cost=0.00..1.34 rows=34 width=66) (actual time=0.014..0.020 rows=34 loops=1)

21. 12.950 12.950 ↓ 0.0 0 925

Index Scan using mdl_reso_id_pk on mdl_resource r (cost=0.42..0.50 rows=1 width=39) (actual time=0.014..0.014 rows=0 loops=925)

  • Index Cond: (cm.instance = id)
22. 1,389.350 1,389.350 ↑ 1.0 1 925

Index Scan using mdl_url_id_pk on mdl_url u (cost=0.29..0.32 rows=1 width=46) (actual time=1.502..1.502 rows=1 loops=925)

  • Index Cond: (cm.instance = id)
23. 71.225 71.225 ↓ 0.0 0 925

Index Scan using mdl_page_id_pk on mdl_page p (cost=0.29..0.33 rows=1 width=44) (actual time=0.077..0.077 rows=0 loops=925)

  • Index Cond: (cm.instance = id)
24. 51.800 51.800 ↓ 0.0 0 925

Index Scan using mdl_assi_id2_pk on mdl_assign a (cost=0.29..0.33 rows=1 width=42) (actual time=0.056..0.056 rows=0 loops=925)

  • Index Cond: (cm.instance = id)
25. 107.300 107.300 ↓ 0.0 0 925

Index Scan using mdl_foru_id_pk on mdl_forum f (cost=0.29..0.32 rows=1 width=31) (actual time=0.116..0.116 rows=0 loops=925)

  • Index Cond: (cm.instance = id)
26. 1.773 248.663 ↓ 1.0 4,764 1

Sort (cost=669.20..681.10 rows=4,758 width=43) (actual time=248.394..248.663 rows=4,764 loops=1)

  • Sort Key: q.id
  • Sort Method: quicksort Memory: 666kB
27. 246.890 246.890 ↓ 1.0 4,764 1

Seq Scan on mdl_quiz q (cost=0.00..378.58 rows=4,758 width=43) (actual time=150.164..246.890 rows=4,764 loops=1)

28. 0.925 0.925 ↓ 0.0 0 925

Index Scan using mdl_fold_id_pk on mdl_folder fo (cost=0.29..0.30 rows=1 width=34) (actual time=0.001..0.001 rows=0 loops=925)

  • Index Cond: (cm.instance = id)
29. 1.850 1.850 ↑ 1.0 1 925

Index Scan using mdl_user_id_pk on mdl_user usr (cost=0.42..8.44 rows=1 width=56) (actual time=0.002..0.002 rows=1 loops=925)

  • Index Cond: (id = log.userid)
Planning time : 9.072 ms
Execution time : 570,960.217 ms