Link to home
Start Free TrialLog in
Avatar of ken hanse
ken hanseFlag for Australia

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?
Avatar of Mike Eghtebas
Mike Eghtebas
Flag of United States of America image

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...
Avatar of Éric Moreau
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.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial