A method and apparatus for improving database concurrency are described. Upon
receiving
a request to access data, a data locality within a database may be determined utilizing
unique data keys. An access to the data may be provided while locking part of the
database based on a data locking level determined based on deadlock history corresponding
to the data locality.