Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there any kind of performance hit when querying by placing tables in different schemas in SQL Server.

For instance if I had 2 tables, Table1 and Table2, and put Table1 into the test schema and Table2 into the history schema, and then I tried to link the tables in a query, is this implicity slower than having the 2 tables in the same schema?

This question came from our site for professional and enthusiast programmers.

1

There should be no performance hit at all. The microsoft oslo project is using schemas extensively, and if there were performance problems, I am sure this would not have been the case.
–
OdedApr 21 '10 at 14:56

There is no difference between querying tables from one schema or multiple schemas in the same database. I use Schemas more for grouping objects together than for anything else. To gain performance by separation, I would go towards filegroups on separate physical drives.
–
Raj MoreApr 21 '10 at 15:14

5

The only place you might hit a penalty is if you don't schema qualify your queries and force the system to figure out where you're pulling from. It's an extremely minor hit, but it's there. Just write the queries correctly and you won't even have that issue.
–
ScaryDBAApr 21 '10 at 18:52