Patent ID: 11947994
Assignee: SAP SE
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 8:
9. A computer-implemented method, comprising:
determining an expected quantity of cache lines accessed by a first transaction, the expected quantity of cache lines being determined based on a quantity of data of a datatype accessed by the first transaction that can be held in a single cache line, the expected quantity of cache lines further being determined based on a quantity of unique values present in a database being accessed by the first transaction;
determining, based at least on the expected quantity of cache lines accessed by the first transaction, an expected workload of the first transaction;
determining, based at least on the expected workload of the first transaction, a threshold quantity of attempts to optimistically perform the first transaction, the threshold quantity of attempts being inversely proportional to a likelihood of conflict arising from the first transaction operating on a same memory location as a second transaction, the likelihood of conflict corresponding to the expected workload of the first transaction, and the optimistic performance of the first transaction comprises performing the first transaction without acquiring a lock to prevent a second transaction from accessing the same memory location as the first transaction;
optimistically performing the first transaction comprising by tracking one or more cache lines accessed by the first transaction and detecting, based at least on the second transaction writing to a cache line accessed by the first transaction, a conflict between the first transaction and the second transaction; and
in response to failing to successfully perform the first transaction after the threshold quantity of attempts to optimistically perform the first transaction,
determining, based at least on the first transaction being an illegal operation and/or the database lacking capacity to support the performance of the first transaction, to perform the first transaction in a fallback mode that comprises acquiring the lock to prevent the second transaction from accessing the same memory location as the first transaction, and
determining, based at least on the first transaction being a legal operation and the database having capacity to support the performance of the first transaction, to continue to optimistically perform the first transaction for another threshold quantity of attempts.