Re: Textbooks on SQL compilation

Torsten Grust <>
31 Mar 1997 15:23:30 -0500

          From comp.compilers

Related articles
Textbooks on SQL compilation (Kevin Watkins) (1997-03-27)
Re: Textbooks on SQL compilation (Torsten Grust) (1997-03-31)
Re: Textbooks on SQL compilation (1997-03-31)
Re: Textbooks on SQL compilation (Kurt Svensson) (1997-04-02)
Re: Textbooks on SQL compilation (1997-04-03)
Re: Textbooks on SQL compilation (1997-04-06)
| List of all articles for this month |

From: Torsten Grust <>
Newsgroups: comp.databases.theory,comp.compilers
Date: 31 Mar 1997 15:23:30 -0500
Organization: Database Research Group, U Konstanz (Lake Constance)
References: 97-03-161
Keywords: SQL

Kevin Watkins <> writes:

> Does anyone know of any text books dealing with the parsing/processing
> of SQL? I'm thinking of something like the book by Holub on compiler
> design, but targeted at SQL rather than a programming language like C.

I'm afraid that you'll have a hard time to find such a book. The
point is that it is not at all clear what the target you compile
``code'' for looks like.

Actually, SQL is based on the relational calculus (with bits from
relational algebra), so many DBMS query processors compile queries
into a calculus representation, normalizing these, and taking the
calculus as a starting point to generate execution plans for the
underlying DB engine.

Since the above approach is often said to be inefficient (I personally
don't subscribe that)---i.e. yielding ``nested loop'' execution
plans---another family of approaches compiles SQL into some sort of
relational algebra, featuring operators like project, select, all
sorts of joins, groupings, etc.

To get it straight, your DB engine is the compilation target. There's
no ``standard'' DB engine nor a standard language (like P-Code, say)
to map SQL to. There have been workshops that strived for a standard
query processing environment but the output is sparse until today.

I'd suggest to have a look at one of the following URLs and employ the
ideas and expertise of the DBMS commnunity as a starting point for the
compilation of SQL (resp. ODMG's OQL):

          EREQ Project:
          COKO KOLA:

Good luck,

    | Torsten Grust |
    | |
    | Database Research Group, University of Konstanz (Lake Constance/Germany) |

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.