|
Posted by bie2 on 05/18/06 22:56
Hi,
I have these two tables in a Database
ITEMS
ID numeric (Primary key)
ZDID nvarchar 3 (not null)
IDF_Family numeric (not null)
Description nvarchar 40 (not null)
DATAS
ID numeric (Primary Key)
IDF_Item numeric (Foreign key)
IDF_Reference numeric (Foreign Key)
[Date] smalldatetime (not null)
Container nchar 10 (not null)
Average decimal (not null)
[%Compliance] decimal (not null)
[%OutOfRange<MinTg] decimal (not null)
[%OutOfRange>MaxTg] decimal (not null)
Target decimal (not null)
[Min] decimal (not null)
[Max] decimal (not null)
The table DATAS has 4000000+ records
I'm running this query:
SELECT DISTINCT I.ID, I.ZDID, I.IDF_Family, I.Description
FROM Items as I, Datas as D
WHERE D.IDF_Item = I.ID AND I.IDF_Family = 84
AND D.Date BETWEEN '5/18/2004' AND '5/18/2004'
it's taking 4-5 minutes to run.
The result is correct, there is no thing on that date.
I've done a reindex, but still the same thing.
What can I do?
Thanks
Navigation:
[Reply to this message]
|