Swarthmore College Department of Computer Science

Talk by Ben Wiedermann, Harvey Mudd College Department of Computer Science

Premature Optimization is the Root of All SQL
Fri, February 24, 2012
SCI 240, 4:30 pm (refreshments at 4:15)


Abstract

All our major financial, health, and government enterprises rely on software systems that manipulate large datasets. These "enterprise applications" are notoriously difficult to design, debug, and maintain. To implement them, programmers typically use a general-purpose, object-oriented programming language to access a relational database. These two things don't mix. As a result, today's programmers are forced to sacrifice good programming practice for the sake of program efficiency.

This talk presents a different approach, namely that program analysis and programming language design can help programmers write enterprise applications that are both well-designed and efficient. The premise of our approach is that programmers perform premature optimization when they write SQL queries. Instead, programmers should describe computations over database data the same way they describe computations over in-memory data. The *compiler* should differentiate the computations and arrange for the program to prefetch database values efficiently. We explore how to implement this compiler-assisted "batching" of database requests and present an elegant language feature that generalizes the technique to many other forms of distributed computing.