From the course: Developing Microsoft SQL Server 2016 Databases

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Introduction to sparse columns

Introduction to sparse columns

- [Instructor] When your data tables have a large proportion of null values in any column, you might consider storing that data in a sparse column defined table. Sparse columns optimize storage for null values, dramatically reducing the storage space required to maintain them. In fact, in a normal table, a null value will still cause the database to reserve space in memory or on disk for potential value. Defining a column as sparse removes this space reservation. However, this comes at a cost of an increase load on system resources to retrieve non-null values. There are a couple of things to keep in mind when considering the use of sparse columns in your table design. First, they're created, altered, dropped, and queried just like any other column in your table. Second, they cannot be applied to the spatial data types of geometry and geography, images, time stamp, text, ntext, or user defined data types. Third, when applied…

Contents