# 1.1
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.userid = 2 AND ev.courseid = 0 AND ev.groupid = 0 AND ev.categoryid = 0);

# 1.2
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.userid IN (3, 4) AND ev.courseid = 0 AND ev.groupid = 0 AND ev.categoryid = 0);

# 2
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid != 0 AND ev.eventtype = 'group');

# 3.1 and 5.1
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid = 2);

# 3.2 and 5.2
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid IN (1, 2));

# 4
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.userid != 0 AND ev.courseid = 0 AND ev.groupid = 0 AND ev.categoryid = 0);

# 6
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE ev.groupid != 0;

# 7
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid = 0 AND ev.courseid != 0 AND ev.categoryid = 0);

# 8.1
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid = 0 AND ev.courseid = 2 AND ev.categoryid = 0);

# 8.2
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid = 0 AND ev.courseid IN (2, 3) AND ev.categoryid = 0);

# 9
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.categoryid != 0 AND ev.eventtype = 'category');

# 10.1
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid = 0 AND ev.courseid = 0 AND ev.categoryid = 1);

# 10.2
EXPLAIN SELECT ev.modulename, ev.instance, ev.eventtype, priority
FROM mdl_event ev
WHERE (ev.groupid = 0 AND ev.courseid = 0 AND ev.categoryid IN (1, 2));
