Hide Forgot
Count: 49435 Time=0.00s (241s) Lock=0.00s (3s) Rows_sent=0.5 (22722), Rows_examined=2234.0 (110439488), beaker[beaker]@localhost SELECT watchdog.kill_time AS watchdog_kill_time, recipe_resource.fqdn AS recipe_resource_fqdn FROM recipe INNER JOIN recipe_set ON recipe_set.id = recipe.recipe_set_id INNER JOIN job ON job.id = recipe_set.job_id INNER JOIN watchdog ON recipe.id = watchdog.recipe_id INNER JOIN recipe_task ON recipe_task.id = watchdog.recipetask_id INNER JOIN recipe_resource ON recipe.id = recipe_resource.recipe_id WHERE job.owner_id = N AND (N = recipe_task.task_id OR recipe.status = 'S') AND watchdog.kill_time <= 'S' Add an index on watchdog.kill_time. It makes a small difference in the query plan according to EXPLAIN (although maybe not enough to satisfy log_queries_not_using_index).
This bug also lacks much for description of what they want.