Handling large databases

前端 未结 14 1834
误落风尘
误落风尘 2021-01-31 00:21

I have been working in a web project(asp.net) for around six months. The final product is about to go live. The project uses SQL Server as the database. We have done performance

14条回答
  •  半阙折子戏
    2021-01-31 01:13

    • First make sure your database is reasonably healthy, run DBCC DBREINDEX on it if possible, DBCC INDEXDEFRAG and update statistics if you can't afford the performance hit.

    • Run Profiler for a reasonable sample time, enough to capture most of the typical functions, but filter on duration greater than something like 10 seconds, you don't care about the things that only take a few milliseconds, don't even look at those.

    • Now that you have your longest running queries, tune the snot out of them; get the ones that show up the most, look at the execution plans in Query Analyzer, take some time to understand them, add indexes where necessary to speed retrieval

    • look at creating covered indexes; change the app if needed if it's doing SELECT * FROM... when it only needs SELECT LASTNAME, FIRSTNAME....

    • Repeat the profiler sampling, with duration of 5 seconds, 3 seconds, etc. until performance meets your expectations.

提交回复
热议问题