The invention belongs to the field of high-performance storage systems and computer
system structures, and particularly discloses an LSM tree reading optimization design method based on a partition ordered
hash table, which is characterized in that a
hash table is maintained in a memory, the table is used for caching a key read from a disk recently, and a file number and a
file size corresponding to the key are recorded; when a user initiates a query request, if a target key is not hit in both the memtable and the immutable memtable, a traditional LSM tree mechanism can directly enter a disk for layer-by-layer query, but in the method, the table can be queried in a memory preferentially. According to the method, the key and the file number and the
file size of the corresponding stable are maintained in real time by utilizing the
hash table of the partition; whenever a new stable is generated, the
system checks whether a key in the new stable is overlapped with an existing key in the hash table, and if the key in the new stable is overlapped with the existing key in the hash table, the file number and the
file size of the corresponding key in the hash table are updated. In this way, the target stable can be directly positioned during query, layer-by-layer traversal is not needed, and therefore the reading speed is effectively increased.