Subject Re: [firebird-support] FireBird : Table Setup, Views and Slow Queries
Author Alexandre Benson Smith
At 09:25 08/04/2004 +0200, you wrote:


> Hi...
>
> I require some help with a (very hectic..?) problem that I am
>currently trying to deal with... At this point in time, the query (at
>the bottom of this message) runs so long that I have to reboot my
>machine to get any processing power back to do my other work...
>Needless to say, my customers are not going to be impressed if they have
>to wait ages to get their report - especially if it takes up all the
>possible resources, on the machine, to extract the reports...
>.... snip...


Werner,

Just a general rule that I have followed...

ALWAYS use SQL/92 join sintax:

select
T1.Field1, T1.Fields2, T2.Field3
from
Table1 T1 join
Table2 T2 on (T2.Field1 = T1.Field1)

instead of

select
T1.Field1, T1.Fields2, T2.Field3
from
Table1 T1, Table2 T2
where
T2.Field1 = T1.Field1

Another rule that I follow:

I always put the tables that will be linked with join first and then after
all joinned tables I put the ones that will be outer joinned. This
increases the performance of some queries a LOT.

But to give you a more precise answer you need to send us the plan for the
problematic queries.

See you !


Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br

----------


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.654 / Virus Database: 419 - Release Date: 06/04/2004


[Non-text portions of this message have been removed]