Speed up database [closed]
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
开发者_如何学运维 Improve this questionI heard, that it is possible to speed up SQL Server by writing all the scripts in one case (UPPER or lower) and turning on special option, that tells Server, that all the commands written in one case.
Is it right? If so, how many benefits it gives? Thanks.I didn't hear something like that. I think, it's a joke or legend :)
No, definitely not.
There are a couple of related things that might have contributed to this strange claim/rumor:
- By default SQL server names are not case-sensitive, but you can set this option at the database level by choosing a case-sensitive collation like "SQL_Latin1_General_CP1_CS_AS". This will make all database object names case-sensitive, but it has no effect on SQL keywords like "SELECT". Note, it will also cause table collations to be case-sensitive by default, so text comparisons will also become case-sensitive unless you choose another collation at the table or comparison level.
- It is good practice to specify the object schema in your SQL statements (eg "dbo.SomeTable" instead of just "SomeTable"), and this provides some small performance benefit as it can save SQL server from needing to look for the same object in multiple schemas.
精彩评论