SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Training
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
SQL Azure
Developer
General DBA
ASP.NET / ADO.NET
SQL Azure

USEFUL SITES :

ASP.NET Tutorials
Windows and SQL Azure Tutorials
Cloud Hosting Magazine
SharePoint Tutorials
Windows Server Help

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server

More     
 
Latest FAQ's

Add Node to A SQL Server failover Cluster failed with invalid ...
SQL Server Destination remote server error
Setting Up Data And Log Files For SQL Server
Will Check Constraints Improve Database Performance?

More     
   
Latest Software Reviews

dbForge Review
Spotlight on ApexSQL Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Data Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Doc 2008

More     

articles >> performance tuning >> Save Space To Boost SQL Server Performance ...

Save Space To Boost SQL Server Performance

By : Neil Boyle
Oct 31, 2002

Page 2 / 2

Space Saving Hints

Consider the following suggestions for saving space:

  • Use VARCHAR instead of CHAR, unless your data is almost always of a fixed length, or is very short.
  • Using Unicode double-byte datatypes such as NCHAR and NVARCHAR take up double (Duh!) the space, so avoid them unless you really need them.
  • Use SMALLINT and TINYINT to save one or three bytes a time if you do not need the big numbers, and use integers instead of Float or Numeric wherever suitable.
  • Using SMALLDATETIME instead of DATETIME saves four bytes, if accuracy to the nearest minute is good enough.
  • Avoid using GUID columns unless you really need them

These are just a few examples, and you should familiarize yourself with the whole range of datatypes in SQL Server, and choose from them very carefully. You might choose to use the SMALLMONEY data type instead of the MONEY type to save 4 bytes a time, but the values this data type can handle are comparatively small, especially if you are dealing with currencies like Japanese Yen or Italian Lira. If you choose a data type that you will eventually outgrow, then this will cause more problems than it’s worth.

 

Index Considerations

Remember that indexes also take up space, so if you keep your indexes small (create only indexes that you are going to use, use narrow columns, and refrain from using long compound indexes if possible) you can improve performance this way too.

Read up on the Fillfactor and Pad_Index options for indexes. In general, SQL Server leaves blank space in it’s indexes to allow for later additions, but if you are indexing a table that never, or very rarely, changes, then you can adjust the fill factor to save space and increase performance.

For tables that change more often, it’s important to do regular table and index maintenance to keep your data compact and efficiently accessible.

 

Other Benefits

Keeping your data as compact as possible does not only reduces the size of your data on disk, it provides other benefits too:

  • You can fit more data into your cache RAM, increasing your cache hit ratio and reducing disk I/O even further.
  • Smaller and faster backups.
  • Less traffic when moving data over the network.
  • Faster joins (short columns are easier to compare than long ones).

 

Further Reading

All the following subjects are well documented in the SQL Server Books Online.

  • SQL Server Datatypes
  • Estimating Space Usage
  • Choosing Efficient Indexes
  • Reading Query Execution Plans
  • Table and Index Maintenance

<< Prev Page         








C# Help and Tutorials | PHP MySQL Tutorial | Sharepoint Tutorial | Azure Tutorial | Cloud Hosting Magazine | ASP.NET Tutorials | Windows Server Help | Windows Phone Pro | Silverlight Ace | Visual Studio Tutorials | Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | SQL Server Training Videos | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 2010 Jude O'Kelly. All rights reserved