Abstract:In the era of big data, traditional indexes (e.g., B+ trees) face challenges, including high memory consumption. Learned indexes are increasingly replacing traditional indexes because of their lower memory consumption and higher query efficiency. However, existing learned indexes struggle to effectively adapt to diverse data distributions and are prone to performance degradation when distribution shifts occur due to new data insertions. To address these issues, this study proposes HCA-Index, a learned index based on data hot-cold awareness. The core components of HCA-Index include 1) designing a progressive partitioning algorithm based on error thresholds to dynamically fit data distributions; 2) constructing a high-precision index by extracting key ranges in a bottom-up manner and adopting hierarchical merging strategies; 3) designing a dynamically evolving data temperature calculation model to identify hot and cold data; and 4) leveraging node-level hot-cold partitioning to support data migration and fast querying. Experiments on real-world datasets demonstrate that, compared with traditional indexes and state-of-the-art learned indexes, HCA-Index significantly reduces query latency, further lowers memory consumption, and effectively reduces the number of retraining operations caused by new data insertions.