Subject | Re: [firebird-support] Re: Optimizer request |
---|---|
Author | Djordje Radovanovic |
Post date | 2016-09-09T14:27:12Z |
Ok. I did not have example like this (I put it as easy to understand
example) but I was curious. Is this kind of clause makes any difference? I made
my test database with tables with same fields as in my example. I made relation
between tables. I filled orders table with 10000 records and partners table with
1000 records. Than I made query same as in my example and received 10000 reads
from orders and 10000 reads from partners where orders were Non-index reads and
partner were Index reads. Than I try this Join cluse and guess what? I received
EXACTLY THE SAME PERFOMANCE ANALYSIS.
Maybe it is something wrong with JOIN clause or maybe I am right...
Regards,
Djole
Sent: Friday, September 09, 2016 3:01 PM
Subject: [firebird-support] Re: Optimizer request
In is slow.
Better to optimize the query like this:
Select o.*
From orders o
Inner join
(
Select
p.Partid
From
Partners p
Where
p.country = SPAIN
}as partidentity
On partidentity.Partid = o.PartID
Which should be faster than a straight join i.e
Select o.* from orders o inner join partners p on p.Partid = o.partid
Where p.country = SPAIN
Jez