Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2009
    Posts
    15

    Unanswered: Performance Comparison of 2 simple queries

    Hi guys,

    Just a quick question.

    Would the perfomance of

    On Server 1
    Select * from Server1.Database1.dbo.Table1

    be the same as

    On Server 1
    Select * from Database1.dbo.Table1 ?

    Thanks a bunch

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I dunno. Does SQL server have to resolve the server name on a open connection to said sql server? Have you googled SET STATSTICS IO? I doubt any difference is perceptible unless you have the maximum number of linked servers or something ridiculous like that.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Apr 2009
    Posts
    15
    Ah, no. On the same server, typical table load of around 50,000 records , indexed. It really was just a curiousity question.

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    The case that you presented doesn't really make sense, because even if you're talking about a linked server to itself, the same parser and QP engine are involved. But if you were talking about a query against a table from a true linked server vs. the same query invoked on that server, than the latter would win. Only when there is a join involved, even if both tables are on the linked server, then you can use REMOTE join hint to force the remote server to process the join conditions before returning the result to the calling server.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    some stuff doesn't work when using loopback linked servers. distributed transactions for example.

    Distributed transaction with linked server: "Transaction context in use by another session."

Posting Permissions

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