those are not my queries! :O
Here they are:
$viewdata['recent-submissions'] = db_query($pdo, '
SELECT w.name AS worker, p.name AS pool, sw.result AS result, sw.time AS time
FROM submitted_work sw, pool p, worker w
WHERE p.id=sw.pool_id AND w.id = sw.worker_id
ORDER BY sw.time DESC
LIMIT 10
');
$viewdata['recent-failed-submissions'] = db_query($pdo, '
SELECT w.name AS worker, p.name AS pool, sw.result AS result, sw.time AS time
FROM submitted_work sw, pool p, worker w
WHERE sw.result=0 AND p.id = sw.pool_id AND w.id = sw.worker_id
ORDER BY sw.time DESC
LIMIT 10
');
FYI, i have not actually even checked what they do exactly, just wrote simplified queries.
EDIT: I just checked, and interestingly doesn't hit index, which is really wierd. Oh well, i check why at better time.