ABSTRACT

A common approach to classify programming languages is around paradigms, broadly defined as fundamental styles of computer programming. A traditional classification distinguishes between imperative languages (in which we specify how to obtain results) and declarative languages (in which we specify what we want without detailing how to reach the answer).∗ In this chapter we contrast these two approaches and motivate the declarative capabilities of Structured Query Language (SQL), the most prevalent query language in relational database systems. We then briefly review how SQL queries are evaluated in modern systems and how, in turn, query processing is influenced by the availability of database indexes. As a consequence, the set of available indexes, or the physical design of a database, is a very important aspect for performance tuning. We next motivate the physical database design problem and note that, unless done automatically, it conflicts with the goal of a declarative language. In fact, understanding which are the right indexes for a given query (or set of queries) forces us to think about how queries would be evaluated. Any effective step toward a solution to the physical design problem not only would make application development more declarative but also would decrease the total cost of ownership of database installations.