Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > faster joins

Reply
Thread Tools

faster joins

 
 
SKG
Guest
Posts: n/a
 
      06-24-2004
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!!!


 
Reply With Quote
 
 
 
 
SKG
Guest
Posts: n/a
 
      06-24-2004
<IGNORE>><IGNORE>>

"SKG" <(E-Mail Removed)> wrote in message
news:%23%(E-Mail Removed)...
> 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!!!
>
>



 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      06-24-2004
As long as they are on the same SQL Server, the JOIN would be just as fast.
Distributed queries are expensive.

Kevin
"SKG" <(E-Mail Removed)> wrote in message
news:##(E-Mail Removed)...
> 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!!!
>
>



 
Reply With Quote
 
SKG
Guest
Posts: n/a
 
      06-24-2004
Thanks!! Kevin. With in the same server will the query be treated as
distributed query.
"Kevin Spencer" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> As long as they are on the same SQL Server, the JOIN would be just as

fast.
> Distributed queries are expensive.
>
> Kevin
> "SKG" <(E-Mail Removed)> wrote in message
> news:##(E-Mail Removed)...
> > 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!!!
> >
> >

>
>



 
Reply With Quote
 
Bojidar Alexandrov
Guest
Posts: n/a
 
      06-24-2004
"SKG" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.


 
Reply With Quote
 
SKG
Guest
Posts: n/a
 
      06-24-2004
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.

"Bojidar Alexandrov" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> "SKG" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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.
>
>



 
Reply With Quote
 
Kevin Spencer
Guest
Posts: n/a
 
      06-25-2004
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.

"SKG" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Thanks!! Kevin. With in the same server will the query be treated as
> distributed query.
> "Kevin Spencer" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > As long as they are on the same SQL Server, the JOIN would be just as

> fast.
> > Distributed queries are expensive.
> >
> > Kevin
> > "SKG" <(E-Mail Removed)> wrote in message
> > news:##(E-Mail Removed)...
> > > 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!!!
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intel Joins the Overclockers Bad Axe 2 Motherboard Silverstrand Front Page News 0 11-29-2006 01:28 PM
Gridview - Inner Joins, DDL, SelectedValue problem Elmo Watson ASP .Net 0 07-07-2006 09:35 PM
How to use DataRelation to perform in-memory joins? Matthi ASP .Net 1 03-28-2006 08:10 PM
Combining a SQL query (joins) Darrel ASP .Net 1 11-11-2004 09:01 PM
Olympus joins the 8 MEGAPIXEL race. R2D2 Digital Photography 9 02-12-2004 03:40 PM



Advertisments