HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Linked server to SQL Azure very slow

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
sqlslowazureveryserverlinked

Problem

I can use the Management studio to connect directly to my Azure SQL database and execute this query:

select * from DB.dbo.DSeries where instrument='name1'


and it works really fast. But if I create a linked server (called "WF") in my local server that connects to Azure and try to execute the same query,

select * from WF.DB.dbo.DSeries where instrument='name1'


The query is really slow. Why could that be happening?

Solution

Try setting the "Collation Compatible" to True on the Linked Server definition.

If you set it to False, it will pull the entire table down and do the compare on the receiving end. Consider the scenario where the local server is case insensitive, and the remote server is case sensitive, the results will differ based on where the compare is done.

Context

StackExchange Database Administrators Q#8184, answer score: 5

Revisions (0)

No revisions yet.