A method, apparatus and computer program product are provided for
implementing enhanced query governor functions. Query execution includes
first checking for a timeout value for a query. Responsive to identifying
a timeout value for the query, an execution time for the query is reset
and a monitor for each timeout value for the query is started. Then the
execution of the query is started. The execution of predefined events is
monitored during the execution of the query. The predefined events
include a begin or end of processing of at least one of a trigger and a
user defined function (UDF). Execution status of the query is
periodically checked. Responsive to identifying the query is executing,
checking for any expired timeout value is performed. The execution of the
query is halted responsive to an identified expired timeout value.