methods , systems , and computer program products are provided for improving the processing of database queries . some embodiments include detecting an overly long running query execution plan , stopping execution of the plan , and utilizing the query optimizer to select an alternate plan for execution . embodiments may utilize system timers which are set with a time limit for the first selected plan , with instructions to re - optimize and initiate selection of an alternate plan when the timer times out . risky constructs may be located in the first plan and removed from future consideration for executing the query . in some embodiments , the additional overhead for non - problem queries consists of little more than creating and sending a message or setting a timer when starting query execution , and canceling a timer upon successful query processing completion . a secondary thread may be created responsive to detecting a long running query , to supervise selecting an alternate execution plan .