I have taken over a database that as a slow Append query.
One of the parts of this slow query in question involves a local table which comes from another 'non-sql' database so I can not get the local table out of the picture. The local table only has 243 records. The other part of the query is coming from a linked sql view which has 3,152,441 records.
Here is the slow query...edited for content to be easier to read :)
Select ds.*
Into DSFiltered
From DirectServices as ds
Inner Join (Select Distinct ClientNumber From LocalTable) as UniqueClients on ds.ClientNumber = UniqueClients.ClientNumber
Is there any way to make this query run faster?
Start Free Trial