Subject | Re: Outer join full scan |
---|---|
Author | Francois Zbinden |
Post date | 2004-04-18T04:47:45Z |
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
itself isn't solved.
like to get some information from the employee table.
Here is a better example:
select p.lastname, e.officenr
from
personlistitems pl,
person p left outer join
employee e on (p.personid = e.personid)
where
pl.personid=p.personid and
pl.personlistid =122;
I select a personlist witch contains 5 persons. A person may be a
employee. If it's a employee i want his office number.
Like the last example, he does a full table scan (600ms). But the
bird should know, I only need the five persons in my personlist.
Without the outer join on employees, bird does the job perfecly
in 50ms on 10'000 persons. I can't find any way to make this better.
Regards
Francois
<aharrison@i...> wrote:
>> Francois aka broesel2003 wrote:Thanks for your nice answer! I understand it better, but the problem
itself isn't solved.
> OK. Is there a measurable performance difference or do you just seethe
> difference when you look a the plan? If there's a measurabledifference in
> the time it takes to execute the query, then there's a problem. If,haven't
> however, you're concerned that the plans are different, then you
> thought the problem through.It's a little problem :) My example had a mistake, of course I
like to get some information from the employee table.
Here is a better example:
select p.lastname, e.officenr
from
personlistitems pl,
person p left outer join
employee e on (p.personid = e.personid)
where
pl.personid=p.personid and
pl.personlistid =122;
I select a personlist witch contains 5 persons. A person may be a
employee. If it's a employee i want his office number.
Like the last example, he does a full table scan (600ms). But the
bird should know, I only need the five persons in my personlist.
Without the outer join on employees, bird does the job perfecly
in 50ms on 10'000 persons. I can't find any way to make this better.
Regards
Francois