{"id":22366547,"url":"https://github.com/microsoft/sql-procbench","last_synced_at":"2025-09-11T12:38:25.520Z","repository":{"id":65976210,"uuid":"349683330","full_name":"microsoft/SQL-ProcBench","owner":"microsoft","description":"SQL-ProcBench is an open benchmark for procedural workloads in RDBMSs.","archived":false,"fork":false,"pushed_at":"2021-09-25T04:02:05.000Z","size":106,"stargazers_count":48,"open_issues_count":1,"forks_count":8,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-07-19T05:49:39.958Z","etag":null,"topics":["benchmark","procedural-extensions","procedural-workloads","rdbms","stored-procedures","triggers","udfs"],"latest_commit_sha":null,"homepage":"","language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2021-03-20T09:40:24.000Z","updated_at":"2025-07-04T17:56:27.000Z","dependencies_parsed_at":"2023-02-19T19:16:07.411Z","dependency_job_id":null,"html_url":"https://github.com/microsoft/SQL-ProcBench","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/microsoft/SQL-ProcBench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FSQL-ProcBench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FSQL-ProcBench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FSQL-ProcBench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FSQL-ProcBench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/SQL-ProcBench/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FSQL-ProcBench/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266869604,"owners_count":23998085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","procedural-extensions","procedural-workloads","rdbms","stored-procedures","triggers","udfs"],"created_at":"2024-12-04T18:13:45.775Z","updated_at":"2025-07-24T16:09:19.322Z","avatar_url":"https://github.com/microsoft.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL-ProcBench\n\nProcedural extensions of SQL have been in existence for many decades now. However, little is known about their magnitude of usage and their complexity in real-world workloads. Procedural code executing in a RDBMS is known to have inefficiencies and limitations; as a result there have been several efforts to address this problem. However, the lack of understanding of their use in real workloads makes it challenging to (a) motivate new work in this area, (b) identify research challenges and opportunities, and (c) demonstrate impact of novel work. To address these limitations, we introduce ***SQL-ProcBench***, an open benchmark for procedural workloads in RDBMSs. \n\nSQL-ProcBench has been carefully and systematically created to model real production scenarios. We have conducted an in-depth analysis of thousands of procedures from real workloads. The insights gained from our analysis has been used to create this benchmark so as to ensure that the complexity, usage patterns and scenarios reflect real workloads. More details about this benchmark can be found in the following VLDB publication:\n\n[Procedural Extensions of SQL: Understanding their usage in the wild.](http://www.vldb.org/pvldb/vol14/p1378-ramachandra.pdf) \\\nSurabhi Gupta and Karthik Ramachandra. \\\nPVLDB, 14(8): 1378 - 1391, 2021. doi:10.14778/3457390.3457402 \n\nThis repository contains the SQL-ProcBench benchmark source code in 3 SQL dialects: T-SQL, PLPgSQL and PLSQL.\n\n## Directory Structure\t\n\u003cpre\u003e\nsrc/ \n  T-SQL/ \n    Scalar UDFs/\n    Stored Procedures/\n    Table Valued UDFs/\n    Triggers/\n  PLSQL/\n    Scalar UDFs/\n    Stored Procedures/\n    Table Valued UDFs/\n    Triggers/\n  PLPgSQL/\n    Scalar UDFs/\n    Stored Procedures/\n    Table Valued UDFs/\n    Triggers/\n  SQL-ProcBench Schema.txt\n  indexes.txt\n\u003c/pre\u003e\n\nThere is a top level directory for each of the three dialects. Each top directory contains 4 sub-directories - one each for Scalar UDFs, Table UDFs, Stored Procedures and Triggers. Each of these directories contain the individual object files which follow the naming convention as described below. Each file has an object definition as a CREATE statement and some also include invocation query examples with plausible parameter values.\n\nThe file 'SQL-ProcBench Schema.txt' contains details about the augmented TPCDS schema used for procbench and includes the DML statements used to create the augmented tables. The same file also describes the process of loading data into the augmented tables. \n\nThe file 'indexes.text' contains the information on indexes and index creation statements.\n\n***File Naming Convention:*** Stored procedures are named as proc\\_\\\u003ci\\\u003e\\_\\\u003cname\\\u003e, scalar UDFs are named as sudf\\_\\\u003ci\\\u003e\\_\\\u003cname\\\u003e, table valued functions named as tvf\\_\\\u003ci\\\u003e\\_\\\u003cname\\\u003e and triggers are named as trig\\_\\\u003ci\\\u003e\\_\\\u003cname\\\u003e; where \\\u003ci\\\u003e is a number identifying the object and \\\u003cname\\\u003e is the name of the object as created inside the database.\n\n## Setup\n1. Create the required tables and indexes using the SQL-ProcBench Schema.txt and indexes.txt files.\n2. Load tpc-ds data into the tables. Data loading instructions for augmented tables can be found in 'SQL-ProcBench Schema.txt' file.\n3. Create procedures by using the create statement commands from the appropriate SQL dialect.\n4. The query examples are given along with each procedure, which can be used to run it. \n\n### Known limitations:\n1) The primary implementation of the benchmark has been done in T-SQL which is then translated to the other dialects. PLPgSQL and PLSQL do not have table variables and these have been implemented using set of records for some of the objects. Implementation for a few other objects which use table variables in these two dialects is still ongoing.\n2) PLPgSQL and PLSQL do not support non-result accumulating select statements inside stored procedures. These have been implemented using REF CURSORS in both these dialects.\n\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fsql-procbench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fsql-procbench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fsql-procbench/lists"}