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
"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?