Subject | index slow down execution of query |
---|---|
Author | anandtripoint |
Post date | 2004-02-23T17:24:09Z |
hello
when i run the sql without index it runs fast if i use the index its
dead slow.
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"."Start Date" <= '02-may-2001'
)
I've index on "Booking"."End Date" & "Booking"."Start Date".
I use Delphi 6 & Firebird 1.5
plan analyzer say that the query uses "Booking"."End Date" and
"Booking"."Client No" and NOT "Booking"."Start Date"
how come i can make it faster?
Thanks
Anand
when i run the sql without index it runs fast if i use the index its
dead slow.
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"."Start Date" <= '02-may-2001'
)
I've index on "Booking"."End Date" & "Booking"."Start Date".
I use Delphi 6 & Firebird 1.5
plan analyzer say that the query uses "Booking"."End Date" and
"Booking"."Client No" and NOT "Booking"."Start Date"
how come i can make it faster?
Thanks
Anand