November 3, 2008 at 3:07 pm
insert Emp
select E.*
from JobType as E , X..EmpIND as ID
where E.EMpid = ID.Empid collate Latin1_General_CI_AI
and E.EmpDate between ID.startDate and ID.endDate
This query takes very longer to run, how cud i improve.
thanks
November 3, 2008 at 7:45 pm
What indexes do you have on the 3 tables?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 3, 2008 at 8:14 pm
we have db's with same schema in the same instance, and this query is ran in all the db's and they run very gud except this db. what might be the reason.
November 3, 2008 at 9:00 pm
1. Have you verified that the schemas and indexes are identical between databases.
2. Is there any difference the number of rows being insert between the databases.
3. Read the article listed below for info on how best to ask for help. Help us help you!
November 4, 2008 at 12:38 am
Mike Levan (11/3/2008)
we have db's with same schema in the same instance, and this query is ran in all the db's and they run very gud except this db. what might be the reason.
Do they have the same amount of data?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 4, 2008 at 12:47 am
Are the statistics updated?
"Keep Trying"
November 4, 2008 at 7:36 pm
Mike Levan (11/3/2008)
we have db's with same schema in the same instance, and this query is ran in all the db's and they run very gud except this db. what might be the reason.
That's why I want you to verify that the indexes... and that they've seen some type of maintenance in the last day.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply