I have this problem when I need to do COUNT(COLUMN_NAME) and SUM(COLUMN_NAME) in multiple tables. The problem is that this is the time on SQL Server to do this.
We have over 2 billion records for which I need to perform these operations.
In Oracle, we can force parallel execution for a single request / session using the PARALLEL hint. For example, for a simple SELECT COUNT we can do
SELECT COUNT(1) FROM USER.TABLE_NAME;
I searched if there is something available for SQL Server, and I could not find something specific where I can provide a table hint for parallel execution. I assume SQL Server decides whether to execute parallel or sequential execution depending on the cost of the query.
The same query in Oracle with a parallel hint takes 2-3 minutes, while on SQL Server it takes about an hour and a half.
source share