{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,6,9]],"date-time":"2026-06-09T08:42:55Z","timestamp":1780994575386,"version":"3.54.1"},"reference-count":36,"publisher":"Association for Computing Machinery (ACM)","issue":"4","license":[{"start":{"date-parts":[[2017,12,1]],"date-time":"2017-12-01T00:00:00Z","timestamp":1512086400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. VLDB Endow."],"published-print":{"date-parts":[[2017,12]]},"abstract":"<jats:p>For decades, RDBMSs have supported declarative SQL as well as imperative functions and procedures as ways for users to express data processing tasks. While the evaluation of declarative SQL has received a lot of attention resulting in highly sophisticated techniques, the evaluation of imperative programs has remained na\u00efve and highly inefficient. Imperative programs offer several benefits over SQL and hence are often preferred and widely used. But unfortunately, their abysmal performance discourages, and even prohibits their use in many situations. We address this important problem that has hitherto received little attention.<\/jats:p>\n          <jats:p>We present Froid, an extensible framework for optimizing imperative programs in relational databases. Froid's novel approach automatically transforms entire User Defined Functions (UDFs) into relational algebraic expressions, and embeds them into the calling SQL query. This form is now amenable to cost-based optimization and results in efficient, set-oriented, parallel plans as opposed to inefficient, iterative, serial execution of UDFs. Froid's approach additionally brings the benefits of many compiler optimizations to UDFs with no additional implementation effort. We describe the design of Froid and present our experimental evaluation that demonstrates performance improvements of up to multiple orders of magnitude on real workloads.<\/jats:p>","DOI":"10.1145\/3186728.3164140","type":"journal-article","created":{"date-parts":[[2019,11,20]],"date-time":"2019-11-20T10:54:54Z","timestamp":1574247294000},"page":"432-444","source":"Crossref","is-referenced-by-count":54,"title":["Froid"],"prefix":"10.14778","volume":"11","author":[{"given":"Karthik","family":"Ramachandra","sequence":"first","affiliation":[{"name":"Microsoft Gray Systems Lab"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Kwanghyun","family":"Park","sequence":"additional","affiliation":[{"name":"Microsoft Gray Systems Lab"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"K. Venkatesh","family":"Emani","sequence":"additional","affiliation":[{"name":"IIT Bombay"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Alan","family":"Halverson","sequence":"additional","affiliation":[{"name":"Microsoft Gray Systems Lab"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"C\u00e9sar","family":"Galindo-Legaria","sequence":"additional","affiliation":[{"name":"Microsoft"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Conor","family":"Cunningham","sequence":"additional","affiliation":[{"name":"Microsoft"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2017,12]]},"reference":[{"key":"e_1_2_1_1_1","doi-asserted-by":"publisher","DOI":"10.5555\/1177220"},{"key":"e_1_2_1_2_1","unstructured":"Query processing architecture guide https:\/\/ms-dn.microsoft.com\/en-us\/library\/mt744587.aspx.  Query processing architecture guide https:\/\/ms-dn.microsoft.com\/en-us\/library\/mt744587.aspx."},{"key":"e_1_2_1_3_1","volume-title":"CIDR. www.cidrdb.org","author":"Cheung A.","year":"2013","unstructured":"A. Cheung , O. Arden , S. Madden , A. Solar-Lezama , and A. C. Myers . Statusquo: Making familiar abstractions perform using program analysis . In CIDR. www.cidrdb.org , 2013 . A. Cheung, O. Arden, S. Madden, A. Solar-Lezama, and A. C. Myers. Statusquo: Making familiar abstractions perform using program analysis. In CIDR. www.cidrdb.org, 2013."},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/2491956.2462180"},{"key":"e_1_2_1_5_1","unstructured":"CLR User-Defined Functions https:\/\/msdn.micro-soft.com\/en-us\/library\/ms131077.aspx.  CLR User-Defined Functions https:\/\/msdn.micro-soft.com\/en-us\/library\/ms131077.aspx."},{"key":"e_1_2_1_6_1","unstructured":"Columnstore indexes guide https:\/\/msdn.-microsoft.com\/en-us\/library\/gg492088.aspx.  Columnstore indexes guide https:\/\/msdn.-microsoft.com\/en-us\/library\/gg492088.aspx."},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.5555\/645914.671634"},{"key":"e_1_2_1_8_1","volume-title":"Microsoft SQL Server 2012 Internals","author":"Delaney K.","year":"2013","unstructured":"K. Delaney , B. Beuchemin , and C. Cunningham . Microsoft SQL Server 2012 Internals . 2013 . K. Delaney, B. Beuchemin, and C. Cunningham. Microsoft SQL Server 2012 Internals. 2013."},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/2463676.2463710"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1247480.1247598"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1145\/3035918.3058747"},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/2882903.2882926"},{"key":"e_1_2_1_13_1","unstructured":"Create Function (MSDN) https:\/\/msdn.micro-soft.com\/en-us\/library\/ms186755.aspx.  Create Function (MSDN) https:\/\/msdn.micro-soft.com\/en-us\/library\/ms186755.aspx."},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/375663.375748"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/38713.38723"},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.5555\/645478.757691"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/800152.804919"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.5555\/502981"},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.1145\/319732.319745"},{"key":"e_1_2_1_20_1","unstructured":"Logical and Physical Operators Reference https:\/\/technet.microsoft.com\/en-us\/library\/ms191158(v=sql.105).aspx.  Logical and Physical Operators Reference https:\/\/technet.microsoft.com\/en-us\/library\/ms191158(v=sql.105).aspx."},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.5555\/286076"},{"key":"e_1_2_1_22_1","unstructured":"Natively compiled stored procedures https:\/\/msdn.-microsoft.com\/en-us\/library\/dn133184.aspx.  Natively compiled stored procedures https:\/\/msdn.-microsoft.com\/en-us\/library\/dn133184.aspx."},{"key":"e_1_2_1_23_1","volume-title":"BTW","author":"Neumann T.","year":"2015","unstructured":"T. Neumann and A. Kemper . Unnesting arbitrary queries . In BTW , 2015 . T. Neumann and A. Kemper. Unnesting arbitrary queries. In BTW, 2015."},{"key":"e_1_2_1_24_1","unstructured":"Performance overhead of SQL user-defined functions http:\/\/glennpaulley.ca\/conestoga\/2015\/07\/performance-overhead-of-sql-user-defined-functions\/.  Performance overhead of SQL user-defined functions http:\/\/glennpaulley.ca\/conestoga\/2015\/07\/performance-overhead-of-sql-user-defined-functions\/."},{"key":"e_1_2_1_25_1","unstructured":"How Functions can Wreck Performance http:\/\/www.oraclemagician.com\/mag\/magic9.pdf.  How Functions can Wreck Performance http:\/\/www.oraclemagician.com\/mag\/magic9.pdf."},{"key":"e_1_2_1_26_1","unstructured":"Subprogram inlining in oracle https:\/\/docs.oracle.com\/cd\/b28359_01\/appdev.111\/-b28370\/inline_pragma.htm.  Subprogram inlining in oracle https:\/\/docs.oracle.com\/cd\/b28359_01\/appdev.111\/-b28370\/inline_pragma.htm."},{"key":"e_1_2_1_28_1","unstructured":"Soften the RBAR impact with Native Compiled UDFs https:\/\/blogs.msdn.microsoft.com\/sqlcat\/-2016\/02\/17\/soften-the-rbar-impact-with-native-compiled-udfs-in-sql-server-2016.  Soften the RBAR impact with Native Compiled UDFs https:\/\/blogs.msdn.microsoft.com\/sqlcat\/-2016\/02\/17\/soften-the-rbar-impact-with-native-compiled-udfs-in-sql-server-2016."},{"key":"e_1_2_1_29_1","unstructured":"PL\/SQL Function Result Cache http:\/\/www.oracle.com\/technetwork\/issue-archive\/2010\/10sep\/o57plsql088600.html.  PL\/SQL Function Result Cache http:\/\/www.oracle.com\/technetwork\/issue-archive\/2010\/10sep\/o57plsql088600.html."},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.5555\/645481.653275"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICDE.2014.6816679"},{"key":"e_1_2_1_32_1","volume-title":"TPC-H Benchmark Specification","author":"TPC.","year":"2005","unstructured":"TPC. TPC-H Benchmark Specification , 2005 , http:\/\/www.tpc.org. TPC. TPC-H Benchmark Specification, 2005, http:\/\/www.tpc.org."},{"key":"e_1_2_1_33_1","unstructured":"Transact SQL https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/language-elements\/language-elements-transact-sql.  Transact SQL https:\/\/docs.microsoft.com\/en-us\/sql\/t-sql\/language-elements\/language-elements-transact-sql."},{"key":"e_1_2_1_34_1","unstructured":"Performance overhead of sql user-defined functions http:\/\/glennpaulley.ca\/conestoga\/2015\/07\/performance-overhead-of-sql-user-defined-functions.  Performance overhead of sql user-defined functions http:\/\/glennpaulley.ca\/conestoga\/2015\/07\/performance-overhead-of-sql-user-defined-functions."},{"key":"e_1_2_1_35_1","unstructured":"Tsql scalar functions are evil http:\/\/sqlblogcasts.com\/blogs\/simons\/archive\/-2008\/11\/03\/tsql-scalar-functions-are-evil-.aspx.  Tsql scalar functions are evil http:\/\/sqlblogcasts.com\/blogs\/simons\/archive\/-2008\/11\/03\/tsql-scalar-functions-are-evil-.aspx."},{"key":"e_1_2_1_36_1","unstructured":"Scalar functions inlining and performance http:\/\/sqlblog.com\/blogs\/adam_machanic\/archive\/2006\/-08\/04\/scalar-functions-inlining-and-performance-an- entertaining-title-for-a-boring-post.aspx.  Scalar functions inlining and performance http:\/\/sqlblog.com\/blogs\/adam_machanic\/archive\/2006\/-08\/04\/scalar-functions-inlining-and-performance-an- entertaining-title-for-a-boring-post.aspx."},{"key":"e_1_2_1_37_1","unstructured":"T-sql user-defined functions: the good the bad and the ugly http:\/\/sqlblog.com\/blogs\/hugo_kornelis\/-archive\/2012\/05\/20\/t-sql-user-defined-functions-the-good-the-bad-and-the-ugly-part-1.aspx.  T-sql user-defined functions: the good the bad and the ugly http:\/\/sqlblog.com\/blogs\/hugo_kornelis\/-archive\/2012\/05\/20\/t-sql-user-defined-functions-the-good-the-bad-and-the-ugly-part-1.aspx."}],"container-title":["Proceedings of the VLDB Endowment"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3186728.3164140","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3186728.3164140","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T19:07:31Z","timestamp":1750273651000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3186728.3164140"}},"subtitle":["optimization of imperative programs in a relational database"],"short-title":[],"issued":{"date-parts":[[2017,12]]},"references-count":36,"journal-issue":{"issue":"4","published-print":{"date-parts":[[2017,12]]}},"alternative-id":["10.1145\/3186728.3164140"],"URL":"https:\/\/doi.org\/10.1145\/3186728.3164140","relation":{},"ISSN":["2150-8097"],"issn-type":[{"value":"2150-8097","type":"print"}],"subject":[],"published":{"date-parts":[[2017,12]]}}}