Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to speed up MS SQL server

I was wondering if anyone has some general sys admin questions on how best to setup MS SQL server for speed. I have placed the log files on a different drive with its own controller and moved the indexes to their drive but on the same controller as the main data files.

What other way can a system admin setup MS SQL server to speed up disk access, query times?

like image 281
Bongani Avatar asked Feb 24 '09 16:02

Bongani


4 Answers

The question is quite general, so a general answer will fit:

  • Use fast hardware. Have as much RAM as possible.
  • If using a 32 bit OS, have AWE working, especially if the machine is a dedicated DB server.
  • If using 64 bit OS - even better. Much more RAM could be put to good use.
  • Analyze indexes and application performance regularly. When needed, rebuild indexes, create new ones, delete old ones, etc.
  • Learn the different types of indexes - Clustered, Partitioned, etc.
  • When necessary, use indexed-views.
  • DB Tuning advisor could help.
  • Use a LoadBalancing solution to have multiple servers running the DB.
  • Understand the nature of the application - OLAP apps has other needs than DataWarehousing apps. This would affect the structure of the tables, disk spanning, etc.
like image 151
Moshe Avatar answered Oct 01 '22 06:10

Moshe


In order of impact on performance, from most important to least:

  • Write faster code using appropriate data definitions and indexes
  • Use faster hardware
  • Configuration tricks of the kind you're asking about here.

While a poorly-configured or under-powered server can kill performance, the typical setup should be good enough that this kind of thing is now pretty far down the list of what you should worry about from a performance perspective.

Of course, if you have a specific unexplained bottleneck then maybe you need to configure something. But you should share that information as well.

like image 39
Joel Coehoorn Avatar answered Oct 01 '22 07:10

Joel Coehoorn


Use the Database Engine Tuning Advisor

like image 36
RuudKok Avatar answered Oct 01 '22 07:10

RuudKok


First of all, I would try to identify the bottleneck; what is the 'thing' where you can improve most / What is the slowest part of your system ?

Is it your code ? (Appropriate indexes, set-based processing, avoid cursors as much as possible, ... ) Is it hardware - related ? Is it configuration-related ? - logs on a separate filegroup / separate disk - can you move some tables to another filegroup , so that tables that are often joined together in queries are in separate filegroups - do you rebuild the indexes often ?

like image 41
Frederik Gheysels Avatar answered Oct 01 '22 05:10

Frederik Gheysels