Tuesday, March 20, 2012

performance problem with linked sybase tables

We have a need to retrieve Sybase data within a MS SQL Server
application. We are using SQL Server's linked database feature with
the Sybase 12.0 OLE DB driver. It takes 5 minutes to run a query that
takes 2 seconds from isql.

Any suggestions?

ThanksLarryboy (dean.roberts@.sscgp.com) writes:
> We have a need to retrieve Sybase data within a MS SQL Server
> application. We are using SQL Server's linked database feature with
> the Sybase 12.0 OLE DB driver. It takes 5 minutes to run a query that
> takes 2 seconds from isql.

I guess you need to do some analysis to see whether it's
a network problem, or whether it could be that the query gets a different
query plan when it comes in on the linked server. If running sp_who
on the Sybase machine through the linked server is fast, then we can
rule out network.

I don't know about Sybase, but on MS SQL Server you can different
query plans depending on the SET options. I don't know if Sybase
has DBCC USEROPTIONS, but if it has, you can run this both in ISQL
and through the linked server, to see if there are any differences.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment