faster joins

S

SKG

I have two databases with in same sql server.
I want to know whether a join of two tables with in same database is faster
or than
join of tables across two databases

Thanks!!!
 
K

Kevin Spencer

As long as they are on the same SQL Server, the JOIN would be just as fast.
Distributed queries are expensive.

Kevin
 
S

SKG

Thanks!! Kevin. With in the same server will the query be treated as
distributed query.
 
B

Bojidar Alexandrov

SKG said:
Thanks!! Kevin. With in the same server will the query be treated as
distributed query.

No.

In fact you cannot run distributed query even with loopback linked server to
itself.
 
S

SKG

Thanks!!

I did some testing and here is what i found.

In QAnalyser, Query cost is almost same when you are in one of the
databases which involves the join.
But when you are in different database, other then the involved tables,
query cost shoots up dramatically.
 
K

Kevin Spencer

A Distributed query is a query which involves databases on different
servers.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top