Database lock management with cache-optimized hash table
AssigneeSap SE
InventorChang Gyoo Park
Life of this patent
Estimating the term…
Abstract
Lock table management is provided for a lock manager of a database system, in which lock management is provided in a manner that is fast and efficient, and that conserves processing, memory, and other computational resources. For example, the lock table management can use a hashmap in which keys and values are stored in separate arrays, which can be loaded into separate CPU cache lines.
Claims20
A computer program product, the computer program product being tangibly embodied on a non-transitory computer-readable storage medium and comprising instructions that, when executed, are configured to cause at least one computing device to:
- receive a lock request for a database element used in a database transaction, specified with respect to a lock table configured to selectively restrict database;
- determine a lock table entry of the lock table for the lock request, the lock table entry stored in a memory and having an array index value, and including a lock key stored in a key array, and further including at least one lock data value stored in a data array;
- load a portion of the key array from the memory to a first cache line of a cache memory, including the lock key associated with the array index value, and one or more additional lock keys that are contiguous with the lock key associated with the array index value;
- and
- execute the lock request by calling the first cache line of the cache memory, identifying an array location in the key array associated with the lock key, and using the array location.
A computer-implemented method, comprising:
- receiving a lock request for a database element used in a database transaction, specified with respect to a lock table configured to selectively restrict database;
- determining a lock table entry of the lock table for the lock request, the lock table entry stored in a memory and having an array index value, and including a lock key stored in a key array, and further including at least one lock data value stored in a data array;
- loading a portion of the key array from the memory to a first cache line of a cache memory, including the lock key associated with the array index value, and one or more additional lock keys that are contiguous with the lock key associated with the array index value;
- and
- executing the lock request by calling the first cache line of the cache memory, identifying an array location in the key array associated with the lock key, and using the array location.
A computer program product, the computer program product being tangibly embodied on a non-transitory computer-readable storage medium and comprising instructions that, when executed, are configured to cause at least one computing device to:
- receive a lock key for a database element to be stored within a lock table configured to selectively restrict database access to maintain database consistency;
- receive at least one lock data value corresponding to the lock key;
- determine a lock table entry of the lock table, the lock table entry stored in a memory and having an array index value, a key array stored in a first column of the lock table, and a data array stored in a second column of the lock table;
- store the lock key within the key array at the array index value;
- store the at least one lock data value within the data array at the array index value receive a request for the lock key;
- load a portion of the key array from a memory in which the lock table is stored to a cache line of a cache memory, the portion of the key array including the lock key and one or more additional lock keys that are contiguous with the lock key in the key array;
- and
- read the lock key from the cache line.
Dependencies are inferred from the claim text.