Subject Re: [firebird-support] Count in Join slowly when using 'in'
Author Helen Borrie
At 01:21 PM 14/02/2005 +0000, you wrote:



>Hi all,
>
>I want to do something like:
>Select Count(*) From Employee E Inner Join Employer R On
>(E.EmployerId=R.Id) Where R.Id In (10,20,30)
>
>This is very slow; When I do Where R.Id=10 it is very fast. What is
>wrong with my query?

Use the left-hand table for the IN() test:
Select Count(*) From Employee E Inner Join Employer R On
(E.EmployerId=R.Id) Where E.Id In (10,20,30)

./hb