[BUG?] equation in ON-clause must be in specific order?

Sven Köhler <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
Hi,

writing
   SELECT * FROM t1
   LEFT JOIN t2 ON (t2.c1=t1.c1)
   LEFT JOIN t3 ON (t3.c2=t2.c2)
is _not_ equal to
   SELECT * FROM table1
   LEFT JOIN t2 ON (t1.c1=t2.c1)
   LEFT JOIN t3 ON (t2.c2=t3.c2)

Well, i'd expect the results to be equal, but the first results in about 
1200 rows, and the second in about 1300 rows which is more.
As far as i can tell, it only affected the second LEFT JOIN in my case, 
but perhaps this is a problem in general.

Perhaps the expressions like t2.c2=t3.c2 should be "sorted" to be 
t3.c2=t2.c2 which might also get better cache performance.
(i noticed that if i swap t3 and t2 in the ON-clause SAPDB performs the 
query much slower the first time run it although it should practically 
be the same query that i executed before)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.