# Intelligent Transaction Scheduling to Enhance Concurrency in High-Contention Workloads
## 2 Fine-grained CC  
Although hot data may constitute only a small portion of a transaction's execution time, traditional CC schemes like two-phase locking (2 PL) [4] and optimistic concurrency control (OCC) [5] operate at the transaction level, either holding locks or aborting entire transactions, leaving much of the potential concurrency unexploited. To overcome this problem, techniques such as transaction chopping [6; 7], IC3 [8], and runtime pipelining [9] decompose transactions into smaller pieces or operations. These techniques enable the early exposure of intermediate results, but they require careful scheduling to prevent deadlocks and cyclic dependencies. For example, if one transaction accesses Table A before B and another accesses them in reverse order, IC3 merges these operations into a single execution unit to avoid cycles--sacrificing parallelism for safety. In real-world OLTP applications, transaction dependencies become increasingly complex due to high-frequency access to hot items and fluctuating client request patterns [10]. Existing methods face fundamental challenges in balancing transaction dependencies and concurrency, which urges the design of _dynamic, dependency-aware scheduling_ frameworks.  
Deep reinforcement learning (DRL) has shown great promise in solving complex combinatorial optimization problems such as graph routing and job scheduling [11; 12; 13]. However, its application to contention-aware scheduling in OLTP systems remains relatively unexplored.  
In this paper, we propose Dynamic Contention Scheduling (DCoS), a DRL-based framework designed to enhance transaction concurrency by adaptively resolving both inter-transaction and intra-transaction contentions. Rather than developing a new high-performance concurrency control scheme, we improve the effectiveness of transaction processing through dependency-aware scheduling, with the capability to adapt to varying levels of contention. We implement a flexible contention identification mechanism based on hot data, enabling DCoS to dynamically switch between lightweight execution for low-contention workloads and DRL-based fine-grained scheduling for high-contention scenarios. Specifically, DCoS introduces a two-stage transaction processing architecture:  
* Transactions are first dynamically partitioned. Transactions without cross-partition contention are executed independently and in parallel across cores.
* Transactions with potential cross-partition contentions are further decomposed into fine-grained operations. A DRL agent is then used to learn contention-aware execution orders, optimizing core utilization and minimizing aborts under dynamic workloads.  
Our contributions are summarized as follows:  
1. We formulate complex-dependency transaction scheduling as a Markov Decision Process (MDP), enabling adaptive execution through learned scheduling policies.
2. We propose an _Adaptive Placement Graph_ structure to jointly encode intra-transaction and inter-transaction dependencies, as well as partition-to-core mappings.
3. We develop a scalable, architecture-agnostic DRL executor with efficient feature embeddings, capable of generalizing across diverse concurrency scenarios and processing environments.
4. We conduct an extensive experimental evaluation to demonstrate the effectiveness of the proposed approach, showing consistent improvements over both existing transaction-scheduling strategies and state-of-the-art CC methods without scheduling.