sql server query running slow from java

前端 未结 13 1933
渐次进展
渐次进展 2020-12-05 12:21

I have a java program that runs a bunch of queries against an sql server database. The first of these, which queries against a view returns about 750k records. I can run t

13条回答
  •  执笔经年
    2020-12-05 12:42

    The fact that it is quick when run from management studio could be due to an incorrectly cached query plan and out of date indexes (say, due to a large import or deletions). Is it returning all 750K records quickly in SSMS?

    Try rebuilding your indexes (or if that would take too long, update your statistics); and maybe flushing the procedure cache (use caution if this is a production system...): DBCC FREEPROCCACHE

提交回复
热议问题