Graph Database Inverted Index for Fast Property Retrieval
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Graph databases face high computational costs for data retrieval and access due to the need for extensive ID establishment, ID conversion, and frequent access to large data storage files stored on disk, leading to low processing speed and efficiency.
Innovation Solution
Implementing an inverted index in memory to directly retrieve storage addresses of node and edge properties, reducing computational overhead and improving retrieval efficiency by allowing quick access to data through O(1) algorithmic complexity.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If an inverted index is implemented in memory to directly retrieve storage addresses, then retrieval efficiency is improved, but memory resource consumption increases
Solution Approach 1:
The inverted index is divided into multiple index files stored in memory, each managing a specific range of node identifiers. This segmentation allows the system to load only necessary index portions into memory, reducing overall memory consumption while maintaining efficient retrieval capabilities for specific data ranges.
Solution Approach 2:
The patent implements a hybrid storage strategy where frequently accessed index data is kept in memory for fast retrieval, while less frequently accessed data is stored on disk. This local quality differentiation optimizes the balance between memory resource consumption and retrieval efficiency by placing each data component in the most appropriate storage medium.
2Reliability
If extensive ID establishment and conversion are performed for graph data, then data storage completeness is improved, but computational overhead increases
Solution Approach 1:
The system pre-establishes an inverted index that maps node identifiers to their storage locations before actual data retrieval operations. This preliminary action eliminates the need for complex ID conversion during query execution, as the index directly provides storage addresses, thereby reducing computational overhead while maintaining complete data tracking.
Solution Approach 2:
The inverted index serves as an intermediary data structure between the graph query system and the actual data storage. Instead of performing extensive ID establishment and conversion operations, the index mediates by directly mapping identifiers to storage locations, significantly reducing computational overhead while preserving data integrity.
3Ease of operation
If frequent access to large data storage files on disk is performed, then data accessibility is improved, but processing speed deteriorates
Solution Approach 1:
The inverted index pre-calculates and stores the mapping between node identifiers and their physical storage locations. This preliminary action enables direct access to data files without requiring sequential scanning or complex search operations, thereby maintaining data accessibility while dramatically improving processing speed.
Solution Approach 2:
The patent replaces the mechanical process of sequential file scanning and ID matching with a direct address lookup mechanism through the inverted index. This substitution eliminates the need for repeated disk access and complex matching operations, maintaining full data accessibility while achieving O(1) retrieval speed.
Data Source
AI summary
Embodiments of this specification provide a retrieval method and apparatus for a graph database. The graph database stores a first graph. The first graph includes a plurality of nodes and an edge connecting the plurality of nodes. The plurality of nodes include a first node. The method includes: obtaining a first identifier corresponding to the first node; obtaining a storage location of first property information from a pre-established inverted index based on at least the first identifier, where the first property information is property information of the first node or property information of a first edge whose endpoint is the first node, and at least the first identifier and the storage location of the first property information are stored in the inverted index in an associated manner; and obtaining the first property information based on the storage location.


