Loop Elimination for Database Updates
The additional expressive power of procedural extensions of query and update languages come at the expense of trading the efficient set-at-a-time processing of database engines for the much less efficient tuple-at-a-time processing of a procedural language. In this work, we consider the problem of rewriting for-loops with update statements into sequences of updates which do not use loops or cursors and which simultaneously carry out the action of several loop iterations in a set-at-a-time manner. We identify idempotence as the crucial condition for allowing such a rewriting. We formulate concrete rewrite rules for single updates in a loop and extend them to sequences of updates in a loop.
KeywordsNest Loop Loop Iteration Crucial Condition Base Salary Database Engine
Unable to display preview. Download preview PDF.
- 1.Antova, L., Koch, C.: On APIs for probabilistic databases. In: QDB/MUD, pp. 41–56 (2008)Google Scholar
- 2.de Kruijf, M.A., Sankaralingam, K., Jha, S.: Static analysis and compiler design for idempotent processing. SIGPLAN Not. 47(6), 475–486 (2012)Google Scholar
- 4.Gupta, A., Mumick, I.S. (eds.): Materialized views: techniques, implementations, and applications. MIT Press, Cambridge (1999)Google Scholar
- 6.Ramalingam, G., Vaswani, K.: Fault tolerance via idempotence. In: Proc. of POPL 2013, pp. 249–262. ACM, New York (2013)Google Scholar