ken hanse
asked on
is schema name does improve the tsql query performance?
I developed some tsql queries and build some SQL views. but did not mentioned the schema name on the table i read from the database.
I used the table in the dbo schema where I mentioned the name as table1 rather than dbo.table1.
is this bad practice and does this slow down the query performance?
I used the table in the dbo schema where I mentioned the name as table1 rather than dbo.table1.
is this bad practice and does this slow down the query performance?
Schema is to combine related logical entities into one physical database to reduce administration overhead. It is best practice from security point of view. Read more...
It has no impact on performance. Even if you don't specify a schema, there is an implicit (default) one in each database (usually dbo).
The impact in the performance is so small that you won't notice it. Especially if you are not using the default schema (dbo).
When you don't specify a schema, SQL Server engine will always look for the object in the dbo schema and then in the user schema. Nowadays, the computers are so fast that this time of search are something around the nanoseconds.
Only issue is if you have the same object name in different schemas and then it will always use the dbo schema since you didn't specify a schema.
When you don't specify a schema, SQL Server engine will always look for the object in the dbo schema and then in the user schema. Nowadays, the computers are so fast that this time of search are something around the nanoseconds.
Only issue is if you have the same object name in different schemas and then it will always use the dbo schema since you didn't specify a schema.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.