Can Learned Models Replace Hash Functions?
Ibrahim Sabek, Kapil Vaidya, Dominik Horn, Andreas Kipf, Michael Mitzenmacher, Tim Kraska
Abstract
Hashing is a fundamental operation in database management, playing a key role in the implementation of numerous core database data structures and algorithms. Traditional hash functions aim to mimic a function that maps a key to a random value, which can result in collisions, where multiple keys are mapped to the same value. There are many well-known schemes like chaining, probing, and cuckoo hashing to handle collisions. In this work, we aim to study if using learned models instead of traditional hash functions can reduce collisions and whether such a reduction translates to improved performance, particularly for indexing and joins. We show that learned models reduce collisions in some cases, which depend on how the data is distributed. To evaluate the effectiveness of learned models as hash function, we test them with bucket chaining, linear probing, and cuckoo hash tables. We find that learned models can (1) yield a 1.4x lower probe latency, and (2) reduce the non-partitioned hash join runtime with 28% over the next best baseline for certain datasets. On the other hand, if the data distribution is not suitable, we either do not see gains or see worse performance. In summary, we find that learned models can indeed outperform hash functions, but only for certain data distributions.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 9e90ed39-bf83-4d5d-a5af-8b622ee4f71eCited by top-tier papers4
- Online List Labeling with PredictionsSamuel McCauley, Benjamin Moseley, Aidin Niaparast, Shikha SinghNeurIPS 2023 · 9 citations
- DeepMapping: Learned Data Mapping for Lossless Compression and Efficient LookupLixi Zhou, K. Selçuk Candan, Jia ZouICDE 2024 · 6 citations
- Learned Static Function Data StructuresStefan Hermann, Hans-Peter Lehmann, Giorgio Vinciguerra, Stefan WalzerVLDB 2026
- Discovering Data Structures: Nearest Neighbor Search and BeyondOmar Salemohamed, Laurent Charlin, Shivam Garg, Vatsal Sharan et al.NeurIPS 2025
Builds on11
- ALEX: An Updatable Adaptive Learned IndexJialin Ding, Umar Farooq Minhas, Jia Yu, Chi Wang et al.SIGMOD 2020 · 274 citations
- Benchmarking Learned IndexesRyan Marcus, Andreas Kipf, Alexander van Renen, Mihail Stoian et al.VLDB 2021 · 185 citations
- Learning Multi-Dimensional IndexesVikram Nathan, Jialin Ding, Mohammad Alizadeh, Tim KraskaSIGMOD 2020 · 180 citations
- Tsunami: A Learned Multi-dimensional Index for Correlated Data and Skewed WorkloadsJialin Ding, Vikram Nathan, Mohammad Alizadeh, Tim KraskaVLDB 2021 · 178 citations
- The PGM-index: a fully-dynamic compressed learned index with provable worst-case boundsPaolo Ferragina, Giorgio VinciguerraVLDB 2020 · 178 citations
Related papers
- HIRE: A Hybrid Learned Index for Robust and Efficient Performance under Mixed WorkloadsXinyi Zhang, Liang Liang, Anastasia Ailamaki, Jianliang XuSIGMOD 2026 · 2 citations
- The Case for Learned In-Memory JoinsIbrahim Sabek, Tim KraskaVLDB 2023 · 27 citations
- Can Learned Indexes be Built Efficiently? A Deep Dive into Sampling Trade-offsMinguk Choi, Seehwan Yoo, Jongmoo ChoiSIGMOD 2024 · 5 citations
- Learned Index: A Comprehensive Experimental EvaluationZhaoyan Sun, Xuanhe Zhou, Guoliang LiVLDB 2023 · 87 citations
- LITS: An Optimized Learned Index for StringsYifan Yang, Shimin ChenVLDB 2024 · 16 citations
