The invention belongs to the technical field of computers, and particularly discloses a persistent CPU (
central processing unit) cache-based data-driven hash indexing method, which comprises the following steps of: constructing a
directory-segment-bucket three-layer extensible hash structure in a persistent memory PM by adopting a
DRAM-PM
hybrid architecture, configuring a
physical separation layout of
metadata and key value pairs in a segment, storing the
metadata in the head of the segment, and storing the
metadata in the head of the segment; the key value pair is stored at the
tail part of the segment; a plurality of round-robin queues are arranged in a
DRAM, requests of index operation are collected and classified through the round-robin queues, a threshold value is set for each round-robin
queue, when the data size in the round-robin queues reaches the threshold value,
batch processing of data in the corresponding round-robin queues is triggered, and the
batch processing is used for conducting batch persistence on the data to PM. According to the method and the device, the read-
write amplification of the PM hash index can be effectively eliminated through the
data layout optimization for the frequently accessed metadata and the
CPU cache optimization for the scattered hash bucket access.