简体   繁体   English

SQL Server 2008链接MySQL服务器缓慢

[英]SQL Server 2008 linked MySQL server slow

Running MSSQL Server 2008 Standard SP 2 64-bit on Win2K8. 在Win2K8上运行MSSQL Server 2008 Standard SP 2 64位。 I have installed on this server the 64-bit MySQL ODBC driver version 5.1.8 from 10/28/2010. 我已在此服务器上安装了2010年10月28日发布的64位MySQL ODBC驱动程序版本5.1.8。 I have configured a DSN linking to a MySQL server 5.1 running on a Mac apple-darwin9.8.0 server (don't ask me, I inherited this). 我已经配置了一个DSN链接到在Mac apple-darwin9.8.0服务器上运行的MySQL服务器5.1(别问我,我继承了这个)。 I have successfully created a linked server via MDSASQL to a specific MySQL database. 我已经成功通过MDSASQL创建了到特定MySQL数据库的链接服务器。

From the SQL Server box I can run simple queries of the nature 从SQL Server框中,我可以运行性质简单的查询

SELECT * FROM mysql_table WHERE id = 1;

However, it is painfully slow. 但是,它非常缓慢。 A query as above takes 19 minutes and 52 seconds to execute; 上面的查询需要19分52秒才能执行; the same query takes 0.04 seconds when executed locally. 在本地执行相同的查询需要0.04秒。

Further, I attempted to execute a simple update of the nature 此外,我尝试执行一个简单的性质更新

UPDATE mysql_table SET field = 0 WHERE id = 1;

This ran for 2 hours before returning the following error: 该程序运行了2个小时,然后返回以下错误:

OLE DB provider "MSDASQL" for linked server "LINKED_MYSQL" returned message "Out of memory.".
Msg 7399, Level 16, State 1, Line 3
The OLE DB provider "MSDASQL" for linked server "LINKED_MYSQL" reported an error. The provider ran out of memory.
Msg 7330, Level 16, State 2, Line 3
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "LINKED_MYSQL".

This comes on the heels of several failed jobs involving updates to the same table, all of which fail approximately two hours after they commence. 在此之前,有几次失败的工作涉及到对同一表的更新,所有这些工作大约在开始两个小时后就失败了。

I have checked the permissions on the mysql and the user specified in the DSN has the appropriate permissions (well, all permissions) in mysql.user. 我已经检查了mysql的权限,并且DSN中指定的用户在mysql.user中具有相应的权限(以及所有权限)。

I would be most appreciative if anyone could give me any avenues to investigate to get this working. 如果有人可以给我任何途径进行调查以使这项工作奏效,我将不胜感激。

Avoid joins to linked server tables and have a look at dynamic openqueries And refer to this question that posted ealier. 避免联接到链接的服务器表,并查看动态openqueries,并参考发布了该问题的这个问题。 Linked Server Performance and options 链接服务器性能和选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM