Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase ««12

Sparse Columns Expand / Collapse
Posted Sunday, March 7, 2010 9:47 AM



Group: General Forum Members
Last Login: Sunday, November 2, 2014 9:13 AM
Points: 488, Visits: 338
Oleg Netchaev (3/5/2010)
ziangij (3/5/2010)
sorry for sounding stupid, but has anybody implemented sparse in his/her code ?

what was the reasoning behind.. is it really worth ?

Implementation of the sparse column makes sense only if the data in the column is, well, sparse. This is because it takes more space to store not null values in the sparse columns. For example, character types, such as char and varchar need twice as many bytes to store not null data if the column is defined as sparse. For those types only if 60% or more of all records are nulls then it makes sense to define the respective columns as sparse. For example, many databases storing consumer/customer/person records might end up having a column storing data for so-called address line 2 which will not have any data in the majority of records, which makes such column a good candidate to be defined as sparse.


Thanks Oleg for providing a relevant example. Appreciate it.

@Jamie - You've got a point there. I think the wording could have been more precise. I am studying for the SQL Server MCTS exam and this topic (on sparse columns) came up somewhere. That's how I came up with the question. Not everything will be relevant to everyone. There are some who just like to learn something for the sheer academic pleasure the learning provides. For some it could turn out into a helpful idea to be implemented in a crux situation, perhaps.

Truthfully, I do SQL Server only because I like the subject matter and want to learn it. I have never used Sparse Columns in my actual experience.

This was my first attempt at posting a question on this wonderful forum. I hope to continue learning and wish all of you the same.


Saurabh Dwivedy

My Blog:

For better, quicker answers, click on the following...

Be Happy!
Post #878334
Posted Sunday, March 7, 2010 2:31 PM



Group: General Forum Members
Last Login: Yesterday @ 4:21 PM
Points: 7,928, Visits: 9,653
Nice question. I hadn't a clue, so today I made time to read all the BOL stuff about FILESTREAM, so today I have learnt more than most days.

Can't imagine why MS decided that columns with filestream values couldn't be sparse, though.

Post #878364
Posted Tuesday, March 30, 2010 8:16 AM

SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: 2 days ago @ 4:18 PM
Points: 9,928, Visits: 11,206
Lucky guess today. Thanks for making me think about it, though can't imagine it will ever be useful.

Paul White
SQL Server MVP
Post #892812
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse