Afternoon all,
Sorry for the absence of updates recently, I’ve been getting stuck into certifications and unfortunately between studying and a full work schedule, finding time for updates has been hard to come by. Hope to get a break soon though and get back to updating regularly. Just a quick one this time, it’s based on the ‘Max Degree of Parallelism’ setting in SQL Server, which I won’t go into in detail as that’s a whole other kettle of fish. (Anyone interested in looking into that further, have a look here).
By sticking the following line at the end of your query, you can restrict the amount of cores that your query will use while running. This is useful if you need to run a big ad-hoc query on a production database, and don’t want to tie up all available resources on regular traffic. So for example on a 4 core system, setting the number to 2 will restrict your query to using 2 cores, leaving the other 2 cores completely free for other use. It doesn’t mean your query has exclusive use of the 2 cores it is accessing, but it keeps it from spilling out into the other resources. Obviously this will slow your particular query down, but it will reduce the impact on day to day business. So the query will look something like :