Subject Re: [firebird-support] Facing big red brick wall (Optional Values)
Author Daniel Rail
Hi,

At May 6, 2006, 5:39 AM, Tom Conlon wrote:

> FB is very fast (~1 sec) when all values are mandatory:

> SELECT t0.candidateid
> FROM candidateAttribute t0
> JOIN CandidateAttribute t1 ON (t1.Candidateid=t0.Candidateid AND
> t1.Attributeid=34 AND T1.RATING<200)
> JOIN CandidateAttribute t2 ON (t2.Candidateid=t0.Candidateid AND
> t2.Attributeid=321 )
> JOIN CandidateAttribute t3 ON (t3.Candidateid=t0.Candidateid AND
> t3.Attributeid=3563 )
> JOIN CandidateAttribute t4 ON (t4.Candidateid=t0.Candidateid AND
> t4.Attributeid=29 )
> WHERE t0.Attributeid =256

What is the query's plan for this query?


> However, add this line (or a NOT variation) for optional attributes
> and FB takes over 3minutes with the server working very hard:
> JOIN CandidateAttribute t5 ON (t5.Candidateid=t0.Candidateid AND
> t5.Attributeid IN(3916,1402,784,3461,2184))

What is the query's plan after adding that line?

--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Consultants Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)