Data storage method and device based on memory database
A data storage and database technology, applied in the direction of database indexing, structured data retrieval, special data processing applications, etc., can solve the problems of read amplification and waste of resources, and achieve the effect of reducing read amplification, avoiding retrieval, and optimizing data storage structure
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0035] A data storage method based on an in-memory database comprises the following steps:
[0036] Divide the data into blocks according to the set number and store them;
[0037] Build a multi-level index, and build a reverse index in each level of index.
[0038] Such as figure 1 As shown, set 1000 pieces of data as a data block, and then cache the data block in the memory; optimize the data storage structure by storing in blocks, and then build an index, and there are reverse indexes in all levels of indexes; when reading It will directly search for the corresponding data in the data block according to the index, reducing read amplification and avoiding the reading of useless data.
Embodiment 2
[0040] Such as image 3 As shown, this embodiment is further based on Embodiment 1, and the process of establishing a multi-level index is as follows:
[0041] S101. Establish a Manifest Block, one Manifest Block, which stores the maximum value of the index in each Index Block and a pointer to the Index Block;
[0042] S102, for the Manifest Block in step S101, a plurality of lower-level Index Blocks are established according to the set threshold, and the IndexBlock stores the maximum value of the index in each Data Block, and a pointer to the Data Block;
[0043] S103. Establish multiple lower-level Data Blocks according to the set thresholds in step S102, and the Data Blocks store indexes and real data.
[0044] When reading, it will first search for the index in the Manifest Block, then search for the index in the Index Block, and finally obtain the data in the corresponding Block cache according to the index of the Data Block and return it; the reading process is more acc...
Embodiment 3
[0046] In this embodiment, on the basis of Embodiment 1, an inverted index is established according to the fixed columns of data, and the fixed columns are spliced into primary keys; this is helpful for partial search and reduces read amplification.
[0047] Such as figure 2 As shown, if the location is used as a fixed column to build a reverse index, the model is used as a fixed column to build a reverse index, and the number is used as a fixed column to build a reverse index.
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com