Relational Index Update via Memory Segmentation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing search engine procedures require reading all involved entities and relations from a disk to memory, leading to inefficiencies and performance degradation due to unnecessary operations and lockmode settings during relation changes.
Innovation Solution
A method for updating a relational index involves reading relational data from a disk to memory, performing updates in memory, storing updated data, writing content data to the disk, and synchronizing the memory index to the disk index periodically, decoupling entities and relations to improve performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If all involved entities and relations are read from disk to memory during search, then search completeness is ensured, but search efficiency deteriorates due to unnecessary operations
Solution Approach 1:
The patent segments entity data and relation data into separate storage structures. Entity data is stored in an entity table while relation data is stored in a relation table. During search operations, only the necessary relation data is loaded into memory from the relation table, while entity data remains on disk. This segmentation allows the system to load minimal necessary data into memory, ensuring search completeness through relation data while avoiding the overhead of loading all entity data, thus resolving the contradiction between search completeness and search efficiency.
2Reliability
If lockmode is set for each involved entity during relation changes, then data consistency is maintained, but performance deteriorates due to increased thread blocking
Solution Approach 1:
The patent segments the data model into separate entity and relation tables, which isolates lock scopes. When a relation change occurs, locks are applied only to the specific relation records in the relation table that are being modified, rather than locking all involved entities. This segmentation of data structures allows for finer-grained locking, maintaining data consistency for the specific relation being updated while minimizing thread blocking on other entities and relations, thus resolving the contradiction between data consistency and system performance.
3Reliability
If entity and relation data are stored together, then data integrity is ensured, but update efficiency deteriorates due to coupled operations
Solution Approach 1:
The patent implements segmentation by creating separate entity and relation tables with defined relationships. Entity data is stored in the entity table with entity IDs as primary keys, while relation data is stored in the relation table with foreign keys referencing entity IDs. This segmentation allows independent updates: relation data can be modified in the relation table without affecting entity data storage, while maintaining data integrity through foreign key constraints. This resolves the contradiction by enabling efficient relation updates without coupled entity operations while preserving data integrity through the structured relationship model.
Solution Approach 2:
The patent extracts relation data from the entity data structure into a separate relation table. This extraction allows relation data to be managed independently from entity data. When relation changes occur, only the extracted relation records need to be updated, not the entire entity data structure. This extraction maintains data integrity through foreign key relationships while significantly improving update efficiency by isolating relation modification operations from entity operations.
4Reliability
If disk reading and writing operations are increased during relation updates, then data persistence is ensured, but thread blocking increases and performance decreases
Solution Approach 1:
The patent implements preliminary action by pre-loading relation data into memory from the relation table before update operations are needed. The relation table is designed to be efficiently queryable and loadable into memory, allowing the system to prepare relation data in advance. During relation updates, the system operates on the pre-loaded in-memory relation data rather than performing disk read-write operations for each update. This preliminary loading of relation data ensures data persistence through the structured relation table while minimizing disk I/O during updates, reducing thread blocking and improving update performance.
Data Source
AI summary
The present disclosure provides a method for updating a relational index, a storage medium and an electronic device. The method includes: reading out relational data of an entity to be operated from a disk to a memory; performing an updating operation on the relational data in the memory; storing the updated relational data into a memory relational index; writing content data of the entity to be operated into the disk; and synchronizing periodically the memory relational index to a disk relational index.


