SELECT me.id FROM ActionRequests me WHERE ( ( action NOT IN ( 'R', 'r', 'q', 'u' ) AND ( ( host = 'uk-collection2' OR host IS NULL ) AND me.starttime IS NULL ) ) ) ORDER BY me.host DESC, me.priority DESC, me.job_id, me.id desc LIMIT 1 ;
this query getting in < 1 sec now taking 15 sec , nothing is changed so far