question

sravan.434 avatar image
sravan.434 asked

can we do multithreading in sql server?

Hi if anyone is aware of multithreading in sql server please let me know
sql-server-2008
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

This is a very vague question. Do you mean on the client or the server? SQL Server will decide at the time of a query whether to use more than one thread to process the query. Controlling this parallelism is best left to the service or to a highly experienced professional.
3 Likes 3 ·
WilliamD avatar image
WilliamD answered
SQL Server is multi-cpu and multi-core capable and will use these if certain conditions are met. What are you trying to do that makes you think you have to consider multi-threading? SQL Server takes care of those things and it is rarely a point to worry about in the beginning, Reads/Writes is something that will cause issues well before CPU/Multi-threading in most cases.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Blackhawk-17 avatar image
Blackhawk-17 answered
SQL Server is a multithreaded application. as @Fatherjack said it decides at execution time whether to use multiple threads on a single query. For overall work SQL Server will roughly balance its load across all processors unless you specify otherwise or are running in certain NUMA situations. SQLOS has a built-in thread manager that maintains a stack for waiting processes. Having said all that it's mostly out of your control; suffice to say that you can launch a lot at it and SQL Server will run as much as it can concurrently.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.