Bug 1297616

Summary: [SLOW QUERY] beaker-usage-reminder: reservations expiring soon
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: schedulerAssignee: beaker-dev-list
Status: CLOSED WONTFIX QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: cbouchar, mjia
Target Milestone: ---Keywords: EasyFix, FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-29 18:45:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dan Callaghan 2016-01-12 02:49:32 UTC
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).

Comment 2 Carol Bouchard 2021-01-29 18:45:59 UTC
This bug also lacks much for description of what they want.