Professional Web Applications Themes

Joining Tables from different DBs => Do I have to care about performance? - Microsoft SQL / MS SQL Server

Hi, I have a more theoretic question: I have two huge tables (db1.dbo.table1 and db2.dbo.table2). I need to join them. Will the effort to join both tables be the same as if both tables were located in the same database? Maybe it even performs better when I copy db1.dbo.table1 to db2 before making the join. Can anybody answer my question? Thanks, Matti...

  1. #1

    Default Joining Tables from different DBs => Do I have to care about performance?

    Hi,

    I have a more theoretic question:

    I have two huge tables (db1.dbo.table1 and db2.dbo.table2). I need to
    join them. Will the effort to join both tables be the same as if both
    tables were located in the same database? Maybe it even performs
    better when I copy db1.dbo.table1 to db2 before making the join.

    Can anybody answer my question?

    Thanks,

    Matti
    Matti Guest

  2. #2

    Default Re: Joining Tables from different DBs => Do I have to care about performance?

    There shouldn't be that much difference as long as both db's are on the same
    server. Certainly not enough to warrant copying the table to the other db.

    --

    Andrew J. Kelly
    SQL Server MVP


    "Matti" <xmrfyahoo.de> wrote in message
    news:a4b6eb66.0307090541.4adb03a5posting.google.c om...
    > Hi,
    >
    > I have a more theoretic question:
    >
    > I have two huge tables (db1.dbo.table1 and db2.dbo.table2). I need to
    > join them. Will the effort to join both tables be the same as if both
    > tables were located in the same database? Maybe it even performs
    > better when I copy db1.dbo.table1 to db2 before making the join.
    >
    > Can anybody answer my question?
    >
    > Thanks,
    >
    > Matti

    Andrew J. Kelly Guest

  3. #3

    Default Re: Joining Tables from different DBs => Do I have to care about performance?

    It doesn't matter if the tables come from two different databases, the optimizer will have the
    same info and same plans, indexes etc can be used as if from one db. Just watch out if you join
    on string columns and have different collations (check the plan that indexes can be used).

    --
    Tibor Karaszi, SQL Server MVP
    Archive at: [url]http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver[/url]


    "Matti" <xmrfyahoo.de> wrote in message news:a4b6eb66.0307090541.4adb03a5posting.google.c om...
    > Hi,
    >
    > I have a more theoretic question:
    >
    > I have two huge tables (db1.dbo.table1 and db2.dbo.table2). I need to
    > join them. Will the effort to join both tables be the same as if both
    > tables were located in the same database? Maybe it even performs
    > better when I copy db1.dbo.table1 to db2 before making the join.
    >
    > Can anybody answer my question?
    >
    > Thanks,
    >
    > Matti

    Tibor Karaszi Guest

Similar Threads

  1. Joining three tables
    By DettCom in forum Coldfusion Database Access
    Replies: 4
    Last Post: July 19th, 06:12 PM
  2. Joining tables, Please help
    By Student_bob in forum Coldfusion Database Access
    Replies: 4
    Last Post: April 19th, 08:49 AM
  3. Joining Multiple Tables
    By kljkhkjhkjh in forum Coldfusion Database Access
    Replies: 7
    Last Post: March 29th, 10:41 PM
  4. joining 3 tables?
    By siti_nana in forum Dreamweaver AppDev
    Replies: 2
    Last Post: February 27th, 08:16 AM
  5. joining 3 tables in dataset
    By Artur Niesporek in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: April 9th, 01:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139