Embodiments of the invention provide a method, article of manufacture, and
an apparatus used to optimize the execution of a database query. One
embodiment includes a computer-implemented method that includes the steps
of receiving a query of a database, prior to executing the query,
analyzing the query to select a locking strategy to use in executing the
query, and executing the query using the selected locking strategy.
Depending on the content of a particular query, or the status of a
database, a query optimizer may determine whether to escalate from a row
level locking strategy to a page level locking strategy when executing
the data query.