Re: multi-statement prepare
Posted in 1997
I stand corrected ------
Subject: Re: multi-statement prepare
From: satriguy@aol.com (SaTriGuy)
Date: 15 Mar 1997 20:34:49 GMT
Message-ID: <19970315203400.PAA26973@ladder01.news.aol.com>
I don't think this is a legal syntax.
When dbaccess or any other front-end tool gets a "double statement"
command,
it actually generates two dynamic queries.
The order of items within the statement is "order independent" in that the
optimizer
will re-order the "where" clauses using mathametical rules of association,
negation, etc. For instance in the following query
select a.a, b.b, c.c
from a, b, c
where a.d = b.d and
b.d = c.d and
a.d > 100
a simple rules based optimizer would be forced to select table a first
because of the a.d > 100. it would then join that subset with table b, and
finally with table c.
What the Informix optimizer would do is to decide, if a.d = b.d = c.d,
then it is also true that the filter could also be a.d > 100 or b.d > 100
or c.d > 100. if c.d > 100
produced the smallest subset of rows, then the optimizer would dynamically
convert the query to
select a.a, b.b, c.c
from a, b, c
where a.d > 100 and
a.d = b.d and
a.d = c.dI think that is what is really meant by "order independent"
Madison Pruet