简体   繁体   中英

Slow Query Execution in Profiler/Fast in MMS

I made an DB auditing to sort out some performance problems one customers has in a part of our software. I used the profiler to look for the queries that were taking too much time. Minutes later i saw the selects that were taking sooo long to execute (up to minutes). As usual i took the selects and let them execute in the management studio to search for missing or bad indexes (execution plan). Then the shock they are blazing fast (milliseconds) and use good indexes. Now my guess was a locking problem but to my surprise the select has the nolock on both tables marker.... Networkproblems seem not to be the hickup here since i have good times from different clients on other selects (the slow selects come from different clients). Just to be sure i maintained the indexes on the 2 inner joined tables used in this select without any success. Other selects with those tables don't have those horrible times. edit: so my not so clear question is what steps should be taken to further look for the problem?

Several questions to answer:

  • is your test environement the same as the productive (customer) environment?
  • What is the difference between test and prod. Environment (eg DB Stats)
  • Do you know of concurrent processes running at customer site?
  • What about the table volumes (number of records)?
  • Key definitions and indexes OK ?
  • and many more steps you could take but start with these ones

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM