Subject Re: [firebird-support] Perfomance problems
Author Arno Brinkman
Hi,

> The union works as fast as expected.
> Is there a rule when to take a union and when to take an or-clause ?

Not that i'm aware off, there are some many situations that it's difficult
to describe in a few lines.

> Has somebody ever made a real world application where the end-user can
> self-construct the queries ?

I'm sure there is, but with self-construct a user can always make something
slowly. Just join 2 large tables together with 1 = 1.

> My examples were very easy.
> In reality the users sometimes make much more complicated queries and it
> seems impossible for me to build optimal queries so that Firebird uses the
> optimal plan.

The problem in your example was due OR-ing two different fields from
different tables. If those fields were from the same table, it would be
better to optimizer (in 1 query).

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81