Drew Kimball is a Member of the Technical Staff on the SQL Queries Team at Cockroach Labs.
Engineering
Product
How CockroachDB Implements UDFs and SPs
User-defined functions (UDFs) and stored procedures (SPs) allow users to define a set of queries that can be executed at the database by providing only the function or procedure name and any relevant parameters. They provide building blocks for users to compose complex queries, which makes applications less error prone since users don’t need to repeatedly provide the complex query. Another benefit of UDFs/SPs is that they enable better performance by moving more computation closer to the data. There are fewer round trips between the application and database to get the results the user wants.
Drew Kimball
August 27, 2024