Re: Bulding a query engine

From: Florian Waas <Florian.Waas_at_cwi.nl>
Date: 2000/01/22
Message-ID: <snmzotyrj6q.fsf_at_hek.cwi.nl>#1/1


> > I am attempting to write an SQL front-end to a custom database for a
> > final year university project. Obviously this involves parsing the
> > language and then query planning & execution. Does anyone have any
> > experience of this, know what approach to take or know where to find
> > appropriate information and resources? Any help would be appreciated.
>
> I built an OQL ( very similar to SQL syntactically)) query engine for my
> research project. Here is what I think it might take:
>
> (1) Parser: A parser that interepts a SQL query into relational algebraic
> expression. An expression can be think of a tree with nodes representing
> operators such as join, selection; with edge representing the data flow
> among operators.

o'reilley's lex&yacc book has a fully fledged SQL parser as example. it's a good thing to start with...

> (2) Optimizer: query planning is a complicated process. One typical
> approach is to build some transformation rules to generate the equivalent
> expressions that hopefully contains more efficient one than the original
> expression derived by the parsing phase. The optimizer will pick the
> expression that is expected to be the best as the optimal plan.
>
> (3) Evaluator: the evaluator includes the physical relational operators using
> specific algorithms. Example of such operators are hash join, sort merge
> join, index-filter.
>
> I think you can find discussion on (2) and (3) in most database texts,
> such as Ullman's , or Date's. Papers discussing these issues can be
> searched in DBLP bibliograph site ( http://www.acm.org/sigmod/dblp/db/ )

fl. Received on Sat Jan 22 2000 - 00:00:00 CET

Original text of this message