Second Level Row Cache for Database Performance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Mobile device databases face performance issues due to the extra computation time required for unpacking rows each time they are accessed, which is exacerbated by the need to adapt to increased memory availability and stricter memory requirements over time.
Innovation Solution
Implementing a second-level row cache that stores unpacked rows, utilizing a specialized memory manager for efficient memory usage and a replacement algorithm to manage cached rows, allowing for shared memory between the page cache and row cache, and dynamically allocating memory to prioritize performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If rows are unpacked (de-serialized) into memory for access, then row data becomes accessible for database operations, but extra computation time is added to each access operation
Solution Approach 1:
The patent applies preliminary action by pre-unpacking row data from the database file and storing it in a second-level row cache before actual database operations are needed. This allows the unpacking computation to be performed in advance, so that when rows are accessed during normal database operations, they are already in unpacked format and ready for immediate use, eliminating the computation time penalty during critical operations.
2Productivity
If a large page cache is used to utilize increased memory availability, then database performance improves through more cache hits, but memory resources are consumed that could be used for other purposes
Solution Approach 1:
The patent applies segmentation by dividing the caching system into two distinct levels: a first-level page cache that stores packed database pages, and a second-level row cache that stores unpacked row data. This segmentation allows each cache level to serve specific purposes with optimized memory usage - the page cache handles bulk page storage while the row cache handles frequent row access operations, thereby improving overall memory resource efficiency and database performance.
3Quantity of substance
If rows are stored in packed format in the database file, then storage efficiency is improved, but unpacking is required for access which adds computation time
Solution Approach 1:
The patent introduces an intermediary component - the second-level row cache - that sits between the packed database file and the unpacked row data needed for operations. This intermediary pre-performs the unpacking transformation and holds ready-to-use unpacked rows, thereby decoupling the storage efficiency benefits of packed format from the computation time penalty of unpacking, as the unpacking is done in advance by the intermediary rather than at the moment of access.
Data Source
AI summary
In an example embodiment, one or more pages from a database are stored in a page cache stored in a shared memory, the one or more pages stored in a packed format. One or more rows from the database are stored in a row cache stored in the shared memory, the one or more rows stored in an unpacked format. A request for a row of the database is received. Then, the row cache is searched for the row. In response to a determination that the row cannot be found in the row cache, the page cache is searched for the row. Finally, the row is returned.


