PostLearn: Towards A Learned Index For PostgreSQL | Proceedings of the 6th Workshop on Challenges and Opportunities of Efficient and Performant Storage Systems

4 min read Original article ↗

Abstract

Recent advances in machine learning based data structures, such as learned indexes, show that models can be trained to approximate the cumulative distribution of keys, thereby predicting key positions more efficiently than traditional indexes. While research prototypes have shown significant promise, so far there has been no comprehensive integration of learned indexes into a relational database system. In this paper, we explore the feasibility of learned indexes for relational systems by introducing PostLearn, an integration of the ALEX+ learned index as a native PostgreSQL index access method. We detail the design and the implementation challenges of embedding a model-based index within PostgreSQL's existing infrastructure and explore its potential performance benefits. While PostLearn can achieve up to 1.5x speedups for point lookups and small range scans compared to the built-in B+-Tree under selected workloads, end-to-end performance benefits are considerably lower than when tested in isolation.

Formats available

You can view the full content in the following formats:

References

[1]

Yifan Dai, Yien Xu, Aishwarya Ganesan, Ramnatthan Alagappan, Brian Kroth, Andrea C. Arpaci-Dusseau, and Remzi H. Arpaci-Dusseau. 2020. From WiscKey to Bourbon: A Learned Index for Log-Structured Merge Trees. In Proceedings of the 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI). 155–171.

[2]

Jialin Ding, Umar Farooq Minhas, Jia Yu, Chi Wang, Jaeyoung Do, Yinan Li, Hantian Zhang, Badrish Chandramouli, Johannes Gehrke, Donald Kossmann, David Lomet, and Tim Kraska. 2020. ALEX: An Updatable Adaptive Learned Index. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data. ACM, 969–984.

[3]

Paolo Ferragina and Giorgio Vinciguerra. 2020. The PGM-Index: A Fully-Dynamic Compressed Learned Index with Provable Worst-Case Bounds. Proceedings of the VLDB Endowment 13, 8 (2020), 1162–1175.

[4]

Alex Galakatos, Michael Markovitch, Carsten Binnig, Rodrigo Fonseca, and Tim Kraska. 2019. FITing-Tree: A Data-Aware Index Structure. In Proceedings of the 2019 International Conference on Management of Data (SIGMOD). ACM, 1189–1206.

[5]

Alireza Heidari, Amirhossein Ahmadi, and Wei Zhang. 2025. DobLIX: A Dual-Objective Learned Index for Log-Structured Merge Trees. Proceedings of the VLDB Endowment 18, 11 (2025), 3965–3978.

[6]

Kyoungmin Kim, Jisung Jung, In Seo, Wook-Shin Han, Kangwoo Choi, and Jaehyok Chong. 2022. Learned Cardinality Estimation: An In-Depth Study. In Proceedings of the 2022 International Conference on Management of Data (SIGMOD). ACM, 1214–1227.

[7]

Andreas Kipf, Ryan Marcus, Alexander van Renen, Mihail Stoian, Alfons Kemper, Tim Kraska, and Thomas Neumann. 2020. RadixSpline: A Single-Pass Learned Index. In Proceedings of aiDM 2020. ACM.

[8]

Tim Kraska, Alex Beutel, Ed H. Chi, Jeffrey Dean, and Neoklis Polyzotis. 2018. The Case for Learned Index Structures. In Proceedings of the 2018 International Conference on Management of Data (SIGMOD). ACM, 489–504.

[9]

Hai Lan, Zhifeng Bao, J. Shane Culpepper, and Renata Borovica-Gajic. 2023. Updatable Learned Indexes Meet Disk-Resident DBMS: From Evaluations to Design Choices. Proceedings of the ACM on Management of Data 1, 2 (2023).

[10]

Hai Lan, Zhifeng Bao, J. Shane Culpepper, Renata Borovica-Gajic, and Yu Dong. 2024. A Fully On-Disk Updatable Learned Index. In Proceedings of the IEEE International Conference on Data Engineering (ICDE). IEEE, 4856–4869.

[11]

Baotong Lu, Jialin Ding, Eric Lo, Umar Farooq Minhas, and Tianzheng Wang. 2021. APEX: A High-Performance Learned Index on Persistent Memory. arXiv preprint arXiv:2105.00683 (2021).

[12]

Ryan Marcus, Parimarjan Negi, Hongzi Mao, Chi Zhang, Mohammad Alizadeh, Tim Kraska, Olga Papaemmanouil, and Nesime Tatbul. 2019. Neo: A Learned Query Optimizer. arXiv preprint arXiv:1904.03711 (2019).

[13]

PostgreSQL Global Development Group. 2025. pgbench — Run a Benchmark Test on PostgreSQL. https://www.postgresql.org/docs/16/pgbench.html

[14]

PostgreSQL Global Development Group. 2025. PostgreSQL Documentation: Concurrency Control. https://www.postgresql.org/docs/current/mvcc.html

[15]

PostgreSQL Global Development Group. 2025. PostgreSQL Documentation: Dynamic Shared Memory. https://doxygen.postgresql.org/dsa_8h.html

[16]

PostgreSQL Global Development Group. 2025. PostgreSQL Documentation: Index Access Method. https://www.postgresql.org/docs/current/index-functions.html.

[17]

PostgreSQL Global Development Group. 2025. PostgreSQL Documentation: Index Access Method Interface Definition. https://www.postgresql.org/docs/current/indexam.html

[18]

PostgreSQL Global Development Group. 2025. PostgreSQL Documentation: Index Types. https://www.postgresql.org/docs/current/indexes-types.html

[19]

PostgreSQL Global Development Group. 2025. PostgreSQL Documentation: Multiversion Concurrency Control (MVCC). https://www.postgresql.org/docs/current/mvcc.html

[20]

PostgreSQL Global Development Group. 2025. Post-greSQL Documentation: Write-Ahead Logging (WAL). https://www.postgresql.org/docs/current/wal-intro.html.

[21]

Michael Stonebraker and Lawrence A. Rowe. 1986. The Design of POSTGRES. In Proceedings of the 1986 ACM SIGMOD International Conference on Management of Data.

[22]

Richard S. Sutton and Andrew G. Barto. 2018. Reinforcement Learning: An Introduction. MIT Press.

[23]

Chaichon Wongkham et al. 2022. GRE: A Benchmark Suite for Learned Indexes. https://github.com/gre4index/GRE

[24]

Chaichon Wongkham, Baotong Lu, Chris Liu, Zhicong Zhong, Eric Lo, and Tianzheng Wang. 2022. Are Updatable Learned Indexes Ready? Proceedings of the VLDB Endowment 15, 11 (2022), 3004–3017.

[25]

Jiacheng Wu, Yong Zhang, Shimin Chen, Jin Wang, Yu Chen, and Chunxiao Xing. 2021. Updatable Learned Index with Precise Positions. Proceedings of the VLDB Endowment 14, 8 (2021), 1276–1288.

[26]

Rong Zhu, Wei Chen, Bolin Ding, Xingguang Chen, Andreas Pfadler, Ziniu Wu, and Jingren Zhou. 2023. Lero: A Learning-to-Rank Query Optimizer. arXiv preprint arXiv:2302.06873 (2023).