简体   繁体   中英

SQL Server 2008 linked MySQL server slow

Running MSSQL Server 2008 Standard SP 2 64-bit on Win2K8. I have installed on this server the 64-bit MySQL ODBC driver version 5.1.8 from 10/28/2010. 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). I have successfully created a linked server via MDSASQL to a specific MySQL database.

From the SQL Server box I can run simple queries of the nature

SELECT * FROM mysql_table WHERE id = 1;

However, it is painfully slow. A query as above takes 19 minutes and 52 seconds to execute; the same query takes 0.04 seconds when executed locally.

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:

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.

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. Linked Server Performance and options

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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