I have a query which joins 6 tables, produces 800,000 rows, and inserts them into a table.
I'm running this query on Sql 2005 Standard on an 8-core machine, on which there is no other workload running. The Sql service uses only one CPU core while running this query (using that CPU for 100%), and this way the query runs for almost 4 minutes.
How could I make my query use all the available CPUs?
Rebuilding the statistics did not help. And there were times, when this query used all the CPU-s and run considerably faster.
(The query also uses two scalar TSQL functions, but this should not be a problem, since it was not before. These functions only use their parameters in the calculations, and they do not access any tables from the database. So using these functions should not prevent the parallelization of the query.)
(Could turning the "read committed snapshot isolation" on on the database cause this behavior? The query ran all right before I turned this on, and it is running on a single CPU since then.)