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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Slow query across databases on same server
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

35 Posts

Posted - 02/28/2013 :  09:50:26  Show Profile  Reply with Quote

We recently created a new database and moved some of our tables there. Whenever we write a query using tables from both databases, the queries take much longer than if the tables were in the same DB. The databases are both on the same server. Does anyone have any idea what might be happening?

Example: The first one takes a lot longer than the second one, and there is an index on column a in all tables.

SELECT top 10 *
FROM   DB1.dbo.Table1
       INNER JOIN DB2.dbo.Table2
       ON     Table1.a = Table2.a

SELECT top 10 *
FROM   DB1.dbo.Table1
       INNER JOIN DB1.dbo.Table2
       ON     Table1.a = Table2.a

Any suggestions are much appreciated.

Thank you.

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 02/28/2013 :  10:18:53  Show Profile  Reply with Quote
have a look at execution plan and identify the time consuming steps

SQL Server MVP

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000