Per-Thread Data Page Extension for Concurrent Table Writes
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In existing database systems, when multiple threads concurrently write data into a data table, they often face inefficiencies due to the need for serial access to shared memory pages, leading to prolonged waiting times and delayed data table extensions, which hinder overall write performance.
Innovation Solution
A data write method where individual threads autonomously extend a predefined number (N) of idle data pages when they cannot acquire an available memory page, allowing them to proceed with writing data, thereby reducing the need for centralized extension and minimizing thread blocking durations.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If one thread centrally extends data pages for all threads that need to write data, then data table extension is coordinated, but thread blocking duration increases and write performance decreases
Solution Approach 1:
The patent divides the centralized extension process into independent per-thread extension operations. Each thread that needs to write data independently extends its own data pages, eliminating the need for a single centralized extension process that blocks all threads. This segmentation allows concurrent thread operations without mutual blocking.
Solution Approach 2:
Each thread performs data page extension autonomously for itself rather than relying on a centralized controller. When a thread determines it needs to write data, it independently extends the data table and allocates memory pages, serving its own needs without requiring other threads to wait for a coordinated extension process.
2Reliability
If multiple threads sequentially acquire write locks on available memory pages, then data integrity is maintained, but write throughput is reduced
Solution Approach 1:
The patent implements preliminary extension of data pages before actual data writing occurs. Threads proactively extend the data table and allocate memory pages in advance, so when they need to write data, the necessary storage capacity is already prepared. This eliminates the need for sequential lock acquisition and waiting during the writing process itself.
Solution Approach 2:
The system dynamically adjusts data table capacity based on individual thread needs rather than using a fixed sequential allocation model. Each thread can independently extend the data table to any required size, allowing flexible and parallel growth of storage capacity without being constrained by a single centralized lock mechanism.
Data Source
AI summary
Embodiments of this disclosure disclose a data write method and apparatus, a computer device, and a storage medium, and pertain to the field of database technologies. In embodiments of this disclosure, when any thread in the computer device obtains no available memory page from a plurality of idle memory pages corresponding to a target data table, the thread may extend N idle data pages for the thread, extend an idle memory page based on the N idle data pages, and write data into the extended idle memory page. It can be learned that the any thread that fails to obtain the available memory page may automatically trigger a data table extension procedure to extend N data pages for the thread in time for use by the thread.


