faster joins

Discussion in 'ASP .Net' started by SKG, Jun 24, 2004.

  1. SKG

    SKG Guest

    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!!!
     
    SKG, Jun 24, 2004
    #1
    1. Advertising

  2. SKG

    SKG Guest

    <IGNORE>><IGNORE>>

    "SKG" <> wrote in message
    news:%23%...
    > 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!!!
    >
    >
     
    SKG, Jun 24, 2004
    #2
    1. Advertising

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

    Kevin
    "SKG" <> wrote in message
    news:##...
    > 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!!!
    >
    >
     
    Kevin Spencer, Jun 24, 2004
    #3
  4. SKG

    SKG Guest

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

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

    >
    >
     
    SKG, Jun 24, 2004
    #4
  5. "SKG" <> wrote in message
    news:%...
    > 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.
     
    Bojidar Alexandrov, Jun 24, 2004
    #5
  6. SKG

    SKG Guest

    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" <> wrote in message
    news:%...
    > "SKG" <> wrote in message
    > news:%...
    > > 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.
    >
    >
     
    SKG, Jun 24, 2004
    #6
  7. 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" <> wrote in message
    news:#...
    > Thanks!! Kevin. With in the same server will the query be treated as
    > distributed query.
    > "Kevin Spencer" <> wrote in message
    > news:%...
    > > As long as they are on the same SQL Server, the JOIN would be just as

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

    > >
    > >

    >
    >
     
    Kevin Spencer, Jun 25, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darrel

    Combining a SQL query (joins)

    Darrel, Nov 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    Scott Allen
    Nov 11, 2004
  2. Matthi
    Replies:
    1
    Views:
    528
    =?Utf-8?B?Z2xlbm4=?=
    Mar 28, 2006
  3. Elmo Watson
    Replies:
    0
    Views:
    434
    Elmo Watson
    Jul 7, 2006
  4. cpnet
    Replies:
    1
    Views:
    426
    cpnet
    Jan 3, 2007
  5. felciano
    Replies:
    5
    Views:
    1,015
    Joshua J. Kugler
    Jun 26, 2007
Loading...

Share This Page