Subject Re: Query Optimisation problems on different platforms
Author phil_hhn
Thanks for your replies Adam and Svein.

Yes we would have expected the same thing whether we used "BR.BR_SN in
(1,5,9)" or "R.BR_SN in (1,5,9)" since they are equivalent via the
inner join. We will try using "R.BR_SN+0 = BR.BR_SN" or similar to try
to force the correct optimisation.

We will have to try with iSQL to see if we can view the plan!

There is not too much else we thought would be worth mentioning; the
'real' tables in our system have a lot more columns and there are
joins to other tables. The databases & queries are the same for both
Mac and Windows (at least until we started pulling this all apart!).
Another thing we noticed - we originally had:
"where BR.BR_SN in (1,5,9) and RECORDSTATUS = 1"
(Every single record has recordstatus set to 1.)
Again, this was part of the query that was ok on Windows, but on the
Mac if we changed the last part to "RECORDSTATUS <> 2", it ran fast,
just as if we had changed "BR.BR_SN in..." to "R.BR_SN in..."!!
However that seemed to not make an improvement if other parts of the
query changed.

This really does seem to be a problem in the automatic optimisation,
we are mainly surprised that there'd be any difference at all between
platforms.