Subject Re: [firebird-support] Re: Bad query optimisation on the MAC?
Author John Bellardo
Phil,

On Nov 26, 2004, at 1:50 AM, Svein Erling Tysvær wrote:

>
>
> Hi Phil, I'm answering simply because no-one else seems to have picked
> it up...
>
> --- In firebird-support@yahoogroups.com, "phil_hhn" wrote:
>> [...]
>> These findings suggest to me that the query optimisation on the MAC
>> has some issues.
>> a) Is it just that the MAC build process is pulling in some outdated
>> query optimisation code? There was no recent super-server binary for
>> the MAC, so I was wondering how often it gets worked on.
>> b) Is there an option to allow me to see the query plan that the
>> database is using?
>> c) Adding an index to TableB.keyword did not help and I gather with
>> text searches involving wildcards that this is the case for most
>> databases. I've been told however that SQL server supports a 'full
>> text index' that makes this type of search much faster - does
>> firebird support something similar?
>
> I'm sorry to say that I know nothing about MACs. In Windows, I would
> recommend you to run IB_SQL and read the plan, but I know nothing
> about neither MAC nor isql (which I expect to be able to produce a
> plan). In general LIKE does not use an index, whereas STARTING does
> (the exception being LIKE <constant>, where the optimizer at the time
> of prepare can see that the first few characters of the string is
> known and as such can benefit from using an index).

In general FB on the Mac is almost identical to FB on any other *nix
platform. The biggest noticeable difference is the location where the
FB tools are installed and the way one would like against the FB "dll".
That being said I suggest you run the query in question from isql with
the "set plan" and the "set stats" option, and compare the differences
in output between the platforms. That is at least a starting point.

-John