Subject Re: Query Optimisation problems on different platforms
Author Adam
--- In firebird-support@yahoogroups.com, "phil_hhn" <time_lord@...>
wrote:
>
> Hi,
> We got to the bottom of a very slow query running on Mac OSX
(Firebird
> 1.5.1). We moved a couple of things around in the query (logically
the
> same query) and a 20second wait reduced to practically nothing.
> Unfortunately this has ruined the performance for the same query
when
> running on Windows.
>
> It seems therefore there are significant differences in query
> optimisation on the two platforms (we would have assumed the
optimiser
> would be the same on both!).

I assume that you have taken into account possible network
configuration errors that may slow it down. Are the databases
identical in contents on both servers? If not the statistics may be
suitably different for the optimiser to attempt another path on the
windows server.

The optimiser gets it right 99% of the time, and the other 1% you
need to encourage it to not use a particular index by adding 0 to the
field in the join etc.

Obviously, you will need to check the query plans on both servers. If
they are identical, then look elsewhere for your problem. Otherwise
you may need to coax the plan on the windows box by disabling the
possibility of an index so it chooses the way it did on the Mac. This
will not affect the Mac performance.

If you get stuck, post your query, query plans on both OS, and
relating table structures and indices.

Adam