I preparing now export procedure from SQL Server to third-party ERP system. It scans almost all tables from database scheme and creates XML for every product. Export is long enough, client wish make it faster. I realised that export procedure utilize only 1 CPU .
So i think if I run the same procedure several times with different parameters (different range of products), i can utilise all processors and it can be faster.
Questions
-
How i can do that using only SQL Server tools.
One of possible solutions is using SSIS. Any other? -
Number of processors can be vary. I can get processors count using
sys.dm_os_sys_info. How dynamically start procedure several times dependable from processors quantity?
A couple of things to bear in mind:
1 – Are you SURE you are CPU bound and not IO bound? In my experience, it’s very rare to have the CPU be the bottleneck in a process and much more likely to have disk access speed restrictions. You should do additional testing to avoid restructuring your entire process only to get a 2% speed increase because your hard drives can’t keep up.
2 – It could be as simple as checking your server-side parallelism setting. Sometimes DBAs set this to 1 because it can mitigate issues with bad query plans, but normally there is limited benefit.
3 – You can set the max degree of parallelism on a query using
OPTION (MAXDOP #)where # is the number of parallel processes you want to allow.