Results 1 to 4 of 4

Thread: Query plans

  1. #1
    Join Date
    Feb 2002
    Location
    Sweden
    Posts
    34

    Unanswered: Query plans

    Hi all,
    I read somewhere that you should write the fully qualified name for a table(db.dbo.table) in order to have a better chance to match the statement to a queryplan/execution plan..

    Iīve tested it to some of the tables in your db with different results, in some cases the query without the "complete path" was up to 3 times heavier to execute(relatively to the batch) than the same query with qualified path(i ran the two at the same time with show execution plan).

    Sometimes there was no difference at all 50%-50% cost. And i wasenīt able to find any logic reason for the sometimes quicker execution with qualified path, sometimes a didnīt even had any statistics created for the column in the where clause when the question was faster than the other one.

    type of statements executed:
    Select Col1,Col2 From db.dbo.table1
    Select Col1,Col2 From table1

    Does anyone know exactly how this works?

    Any help would be mostly appreciated
    Jonas
    - Jonte

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    The times that they were equal - were both queries on the fast side or slow side ?

  3. #3
    Join Date
    Feb 2002
    Location
    Sweden
    Posts
    34
    "The times that they were equal - were both queries on the fast side or slow side ?"

    I really donīt know..They where both executed with the same cost. My guess is that both queries where matched to an existing execution plan and should therefor been on the fast side.

    Q2: Letīs say that we have a stored proc that is compiled and sqlserver has generated a execution plan for it, right. Does the created execution plan uses other already created plans for the statements in the proc or does it creates a completely new one just for the statments in the proc?
    - Jonte

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Take a look at Recompilng a Stored Procedure in bol. If you need more information or a better explanation, let me know.

Posting Permissions

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