I have a few databases with identical schema, lets call:
I have a query that when run takes 11 seconds and returns 11K (11000) records on DB_A but when the exact same query is run on the identical DB_B it takes 40 seconds and returns 7K (7000) records.
The schema is identical, but when i run it on DB_B it runs on Degree of Parallelism 1, on DB_A it runs on 16.
I tried setting the cost of threshold to 0 to force parallelism but got the same result.
Why is that? How can the same query running on cloned databases behave so differently?
Any ideas are welcome. I'm using SQL 2017 Standard.