Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SqlException (0x80131904): Timeout expired.

Author  Topic 

raysefo
Constraint Violating Yak Guru

260 Posts

Posted - 2011-10-18 : 08:31:23
Hi,

I produced a execution plan. The problem is, Remote Query Cost is 51% I have a linked Server to Oracle 11g. Any suggestions how can I reduce this cost?

Best Regards.

I am trying to run a query as follows:
Select
...
FROM [Test]..[Schema].[TableName]
INNER JOIN Table2
LEFT JOIN Table3
...

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-18 : 08:53:51
put the oracle results to temporary table, add indexes to columns used for joins and then use it in above query.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

raysefo
Constraint Violating Yak Guru

260 Posts

Posted - 2011-10-18 : 09:00:35
Hi visakh16,

Do you mean put the Oracle results into SQL Server table? There are primary keys on the tables, do I need extra keys?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-18 : 09:44:10
yep. exactly
if you've pks its fine. if there's any other fields used in where etc consider creating a non clustered index on them too

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -