I have a query that I run on a database on the server and it takes about 30 seconds. If I only change the database (use master;) the query runs in 2 seconds. Changing back (use Reporting_Dev;) it is back to 30+ seconds.
From each DB, there are very different query plans, but I am puzzled why this happens. It is the same query. All I did was switch the database I am running from.
The compatibility of the databases is the same so I am at a loss.
Any ideas?