Subject index slow down the query
Author anand anand
hello

I use Delphi 6 and Firebird 1.5.

SQL

select count(*)
FROM "Client" WHERE "Client"."Client No" in
(

SELECT DISTINCT "Booking"."Client No" FROM "Booking"
WHERE "Booking"."End Date" >= '02-feb-2001' AND
"Booking"."St Date" <= '02-may-2001'

)

there is index on "Booking"."End Date" and
"Booking"."St Date"

if i remove the index its working fast. both the
client and booking table has more that 300,000
records.

plan Analyzer says that this query uses "Booking"."End
Date" & "Booking"."Client No" indices and NOT
"Booking"."St Date" index.

how do i make it work fast with index.

Thanks

Anand





___________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html