Forcing a query to single thread? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Forcing a query to single thread?

Hi. Newbie here and not really a developer… Just trying to sort out a mess we’ve been left with![<img src=’/community/emoticons/emotion-6.gif’ alt=’:(‘ />]<br /><br />I’ve searched the forum, but if this has already been answered, I could not find it and apologise. Is there a way of forcing a stored procedure or query to run single-threaded on a multi-processor (2 x dual core Zeon) system please?<br /><br />I have one inherited query that is causing sever performance problems and I believe running it single thread my help. However, I do not want to tinker with the number of threads, change the number of processors to use or adjust the minimum query plan as most of the system is running fine.<br /><br />Many thanks .<br /><br />
Use the "maximum degree of parallellism" setting … SELECT *
FROM table
OPTION (MAXDOP=1) Setting applies only to the query in which the option is mentioned. For consecutive queries, you would have to repeat the option.
Brilliant …. Thanks.