Evaluating the Performance, Scalability, and Maintainability of Stored Procedures in Modern Relational Databases: Practical Insights and Benchmarks
In several production systems we worked with, stored procedures were often treated as legacy artifacts rather than active performance tools, even though our experience showed that they could still contribute meaningfully to performance and maintainability when used carefully. Even with all these benefits, many organizations rely on inline SQL queries embedded in application code, the program’s logic gets all messed up, checks all over the place, and easier to hack. Stored Procedures (SPs) remain a cornerstone in relational database management, providing encapsulation of SQL logic, enhancing performance, and improving security [1,2]. Despite their long history, SPs are still relevant in modern applications, particularly in cloud-native architectures, high-concurrency OLTP systems, and microservices-based platforms [3,4]. We look at the performance, scalability, and maintainability of SPs in SQL Server 2022 and PostgreSQL 15. Using realistic workloads, including HammerDB simulations for OLTP and TPC-H derived queries for analytical scenarios [5,6], we combine quantitative benchmarking with human-centric observations. Real-world challenges, such as bulk operation bottlenecks, transaction management, and exception handling, are explicitly discussed. In here we analyzed that well-designed SPs can improve operation performance by 25–45%, while poorly structured SPs may degrade performance and reduce maintainability. We provide actionable recommendations for developers and database administrators, emphasizing the integration of empirical practice with theoretical knowledge
Authors
- Mohammad Amir Sedaqat
Institutions
- Renewable Energy Systems (United States) (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-01-08
- DOI
- https://doi.org/10.5281/zenodo.18189513
- Primary Topic
- Advanced Database Systems and Queries
- Type
- article
- Field-Weighted Citation Impact
- 0.00