开发者

SQL Server not running queries on remote (Linked MySQL) server

开发者 https://www.devze.com 2023-02-17 02:22 出处:网络
For various horrible reasons, we\'ve had to link SQL Server to a MySQL database using Linked Servers and an ODBC Data Source. The queries run fine, but looking at the query plans you can see that SQL

For various horrible reasons, we've had to link SQL Server to a MySQL database using Linked Servers and an ODBC Data Source. The queries run fine, but looking at the query plans you can see that SQL Server is always doing a full table scan on the remote server - and then doing any joins/filtering at the SQL Server end.

Ho开发者_开发技巧w can we push these to the MySQL server instead?

Thanks

James


If you write your queries like this ...

select * from openquery
 ( myLinkedServer
  ,'Select * from mySQLTables where complicated joins/filters')

the joins/filters should happen remotely.

0

精彩评论

暂无评论...
验证码 换一张
取 消