1. A computer-implemented method of optimizing database query execution; comprising: receiving a query configured to be executed against a database containing data; prior to executing the query, analyzing the query to select a locking strategy to use in executing the query, the locking strategy being selected from at least two different locking strategies, wherein the locking strategy specifies which of the data to prevent other queries from accessing when the query is executed; and executing the query using the selected locking strategy.