Performance evaluation of B-Tree and hash indexing under varying data sizes in relational database systems
Abstract
This study investigates query performance optimization in relational database management systems (RDBMSs) by evaluating two common indexing techniques, B-Tree and Hash indexing, under varying dataset sizes. With the rapid growth of data generated by IoT systems, enterprise applications, and digital services, efficient query execution has become essential for maintaining scalability and system performance. The research compares three database configurations: no indexing, B-Tree indexing, and Hash indexing, while applying a Cost-Based Optimization (CBO) strategy to improve query plan selection. Experimental results reveal that query response time increases significantly with larger datasets, especially when no indexing is used. Both indexing methods substantially enhance performance compared to full-table scans, achieving improvements ranging from 35% to 60% depending on dataset size and query workload. The measured speedup factors reached up to 2.60×, confirming the effectiveness of indexing in reducing execution time. Further analysis indicates that B-Tree indexing consistently performs better than Hash indexing in large-scale and mixed-query environments due to its logarithmic search efficiency and support for range queries. B-Tree indexing reduced execution time to nearly 40–45% of the baseline, whereas Hash indexing achieved approximately 55–60% under similar conditions. The findings emphasize that selecting an appropriate indexing strategy is critical for optimizing database query performance, and that the effectiveness of each method depends largely on workload characteristics and dataset scale.
Copyright (c) 2026 Hassan Bediar Hashim

This work is licensed under a Creative Commons Attribution 4.0 International License.
References
[1]Anchlia A. Enhancing Query Performance Through Relational Database Indexing. International Journal of Computer Trends and Technology. 2024; 72(8): 130–133. doi: 10.14445/22312803/IJCTT-V72I8P119
[2]Saidu IC, Yusuf M, Nemariyi FC, et al. Indexing techniques and structured queries for relational databases management systems. Journal of the Nigerian Society of Physical Sciences. 2024; 2155. doi: 10.46481/jnsps.2024.2155
[3]Patil SA, Sangam S. An Exhaustive Survey of Big Data Storage Reduction Techniques. Cureus Journal of Computer Science. 2025; 2(1). doi: 10.7759/s44389-025-03518-3
[4]Sakshi S, Sharma A. Relational Database Performance Optimization Techniques. In: Bhalerao S, Gupta R, Kate V (editors). Advances in Intelligent Systems Research, Proceedings of the International Conference on Recent Advancement and Modernization in Sustainable Intelligent Technologies & Applications (RAMSITA-2025); 7–8 February 2025; Indore, India. Atlantis Press International BV; 2025. pp. 112–124. doi: 10.2991/978-94-6463-716-8_10
[5]Toktomusheva G. Indexing in PostgreSQL: Performance Evaluation and Use Cases. Preprint. 2025. Available online: https://www.preprints.org/manuscript/202511.2170
[6]Azmat H, Huma Z. Indexing Strategies in SQL: Enhancing Query Efficiency and Scalability. Baltic Journal of Multidisciplinary Research. 2025; 2(2): 130–138. Available online: https://balticpapers.com/index.php/bjmr/article/view/53?utm_source=chatgpt.com
[7]Abbasi M, Bernardo MV, Váz P, et al. Revisiting Database Indexing for Parallel and Accelerated Computing: A Comprehensive Study and Novel Approaches. Information. 2024; 15(8): 429. doi: 10.3390/info15080429
[8]Robinson E, Anderson J. Comparative Study of Adaptive Indexing Techniques for Performance Improvement in Dynamic Workloads. Journal of Innovation in Governance and Business Practices. 2025; 1: 32–58. doi: 10.66096/JIGBP.V1.2
[9]Malakar KD, Roy S, Kumar M. Database Management System: Foundations and Practices. In: Geospatial Technologies in Coastal Ecologies Monitoring and Management, Advances in Geographic Information Science. Springer Nature Switzerland; 2025. pp. 191–255. doi: 10.1007/978-3-031-92017-2_7
[10]Huang K, Shen Z, Shao Z, et al. HaSiS: A Hardware-assisted Single-index Store for Hybrid Transactional and Analytical Processing. In: Proceedings of the 23rd USENIX Conference on File and Storage Technologies, FAST 2025; 25–27 February 2025; Santa Clara, CA, USA. pp. 305–320. Available online: https://www.usenix.org/system/files/fast25-huang.pdf
[11]Farhaoui Y, Ziani S, Taherdoost H, et al. Enhancing Scalability and Performance in Big Data Query Processing: A Multi-faceted Approach. In: Intersection of Artificial Intelligence, Data Science, and Cutting-Edge Technologies: From Concepts to Applications in Smart Environment, Lecture Notes in Networks and Systems. Springer Nature; 2025. pp. 498–507. doi: 10.1007/978-3-031-88304-0_69
[12]Lu T, Li M, Lu W, et al. Recent progress in the data-driven discovery of novel photovoltaic materials. Journal of Materials Informatics. 2022; 2(2): 7. doi: 10.20517/jmi.2022.07
[13]Wu Y. Mining Threat Intelligence from Billion-Scale SSH brute-Force Attacks [Master’s Thesis]. University of Illinois at Urbana-Champaign; 2020. Available online: https://www.ideals.illinois.edu/items/115715
[14]Yu J, Sarwat M. Hippo: A Fast, yet Scalable, Database Indexing Approach. arXiv preprint. 2016. doi: 10.48550/arXiv.1604.03234
[15]Ding J, Minhas UF, Yu J, et al. ALEX: An Updatable Adaptive Learned Index. In: Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data; 11 June 2020; Portland, OR, USA. pp. 969–984. doi: 10.1145/3318464.3389711
[16]Das SK, Ray S. Learned Adaptive Indexing. arXiv preprint. 2025. doi: 10.48550/ARXIV.2508.03471
[17]Roh H, Park S, Kim S, et al. B+-tree Index Optimization by Exploiting Internal Parallelism of Flash-based Solid State Drives. arXiv preprint. 2012. doi: 10.48550/ARXIV.1201.0227
[18]Documentation: Manuals. Available online: https://www.postgresql.org/docs/ (accessed on 10 August 2025).
[19]Tudoroiu IA. Advances in Indexing Techniques for Database Systems: A Systematic Literature Review. The Scientific Bulletin of Electrical Engineering Faculty. 2025; 25(2): 51–54. doi: 10.2478/sbeef-2025-0022
[20]Pagh R, Rodler FF. Cuckoo hashing. Journal of Algorithms. 2004; 51(2): 122–144. doi: 10.1016/j.jalgor.2003.12.002
[21]Lu H, Yuet YN, Tian Z. T-tree or B-tree: Main memory database index structure revisited. In: Proceedings of the 11th Australasian Database Conference; January 31–February 3 2000; Canberra, ACT, Australia. pp. 65–73. doi: 10.1109/ADC.2000.819815
[22]Li J, Hui B, Qu G, et al. Can LLM Already Serve as A Database Interface? A Big Bench for Large-Scale Database Grounded Text-to-SQLs. arXiv preprint. 2023. doi: 10.48550/ARXIV.2305.03111
[23]Bayer R, McCreight E. Organization of large ordered indexes. Acta Informatica. 1972; 1: 173–189. Available online: https://harrymoreno.com/assets/greatPapersInCompSci/7.2_-_Organization_and_Maintenance_of_Large_Ordered_Indexes-R._Bayer,E._McCreight.pdf
[24]Pan JJ, Wang J, Li G. Survey of Vector Database Management Systems. arXiv preprint. 2023. doi: 10.48550/ARXIV.2310.14021
[25]Nevarez B. SQL Server Query Tuning and Optimization: Optimize Microsoft SQL Server 2022 Queries and Applications. Packt Publishing; 2022.

