Method of managing memory database space by using bitmap
A database and bitmap technology, applied in the management field of in-memory database systems, can solve the problems of reducing system reliability and maintainability, reducing memory space utilization, and low overall space management efficiency, so as to improve multi-task performance, memory The effect of high space utilization and good scalability
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Publication Date
- 2013-06-05
- Estimated Expiration
- Not applicable · inactive patent
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
Description
technical field
[0001] The invention relates to a management method of a memory database system, in particular to a method for efficiently managing memory database space by using a bitmap. Background technique
[0002] Traditional database management systems manage all data on disks, so they are called disk databases. The disk database needs to frequently access the disk to perform data operations. On the one hand, the operation of reading and writing data on the disk requires the mechanical movement of the head, and on the other hand, it is affected by the system call time. When the amount of data is large, the operation is frequent and complicated. , many problems will be exposed.
[0003] In recent years, memory capacity has continued to increase and prices have continued to fall. After computers have entered the 64-bit era, the operating system can already support larger address spaces. At the same time, the industry's requirements for real-time response capabilities of...
Examples
Embodiment 1
[0101] Example 1, such as image 3 As shown, in a typical application scenario, the complete process of initializing and allocating a data page includes the following steps:
[0102] Step A1: It is set in the database system configuration that m MB of memory will be used, where m is a positive integer; and the host supports memory allocation of this capacity. At the same time, set the size of each page as p KB; where, p is a positive integer.
[0103] Step B1: After the database system is started, allocate m by opening up shared memory or similar methods
[0104] MB memory. Assume that the first address of the memory segment is g, where g is a natural number.
[0105] Step C1: Calculate the required primary bitmap area size b1=(m*1024) / (p*8), unit byte.
[0106] Step D1: reserve b1 byte space at the beginning of the total memory segment as a first-level bitmap area, and initialize the bitmap area to all 0s.
[0107] Step E1: Allocate space for the first-level bitmap auxil...
Embodiment 2
[0115] Example 2, such as Figure 4 As shown, in a typical application scenario, the complete process of applying for a record space includes the following steps:
[0116] Step A2: The upper layer business sends a request to apply for a record space in the nth data page.
[0117] Step B2: Locate the first address of the secondary bitmap area of the data page according to the algorithm of steps I1 and J1, find the first available bit in this area according to a certain algorithm, if found, set it to 1, indicating that it has been allocated, and Return success; if not found, go to step C2.
[0118] Step C2: Return the error message "No space left on this page" to the caller
Embodiment 3
[0119] Example 3, such as Figure 5 As shown, in a typical application scenario, the complete process of releasing a record space includes the following steps:
[0120] Step A3: The upper layer business sends a request to release the nth record space in the mth data page. Among them, m and n are natural numbers.
[0121] Step B3: Locate the first address of the secondary bitmap area of the data page according to the algorithm of steps I1 and J1, locate the nth bit, and set it to 0, indicating that it has been recycled, and return successfully; if not found, go to Step C3.
[0122] Step C3: return the error message "page number or record number is illegal" to the caller.