Response regarding coding efficiency

Kyle Lahnakoski
Tue, 27 Jun 2000 18:21:26 -0400

"Lynn H. Maxson" wrote:

> It occurs in every SQL query.  Users are interested
> in results, not in how they are achieved.  That the
> logic engine organizes it in a manner far different
> than it is written is of no interest to the user as
> long as it satisfies his purpose: logical
> equivalence.

This is the second time that you bring up SQL.  SQL should be an
excellent example of the difficulty involved in executing a
specification most efficiently.  

Queries are simple constructs with very limited expressive
permutations.  It should be one of simplest languages to optimize.  Yet
the vendors, with an interest in making their queries run fast, have
been unable to optimize queries.  Without mentioning indexing, or
tablespace allocation, and just with the phrasing of the SQL, I can make
significant performance improvements in a query.  An example in Oracle
is the use of the "in" keyword; it is better to join the tables than to
use the 'in' clause.  If queries are so difficult to optimize, then a
general specification language is much more difficult.

Optimization is not just a measure of finding the fastest running
equivalent statement, it is about providing necessary information to the
automatic optimizer.  

Providing a language (or set of languages) that force the programmer to
provide the necessary optimization information, and/or making analysis
algorithms to perform optimization, will take a lot of work.

I am not saying that your statements are incorrect.  I say that they do
not emphasis the complexity of the solution you are proposing. 

Kyle Lahnakoski                                  Arcavia Software Ltd.
(416) 892-7784