Avatar of websss
Flag for Kenya

asked on 

reducing columns and consolidating to one column for performance?


I have a table with 39 columns
the table holds telemetry data, the table grows rapidly at a rate of 10-50 rows per second
It holds hundreds to millions of records and will just keep growing

I want to try and increase performance using multiple means, one of the areas is related to this question
I have identified 20 columns which could be consolidated into one column as a CSV as the data does not need to be directly queried

These columns are of data types Char(1), varchar(6), varchar(20), float, smallInt, int etc
A lot of times these column values are null as the data simply isn't present

I want to store all these in varchar column (not sure of size yet)
If all data is null, there would be 20 commas in this column
usually it will contain some type of data though so may look like this:

My question is, is it worth doing the above to save on data size and increase performance since 39 columns would span many pages

I know I haven't given much in depth detail, so please ask if I need to give specifics

My goal is to reduce DB size and increase performance (yes i've already looked at indexes etc, and they are working well...thats a conversation for a different thread)
Microsoft SQL Server

Avatar of undefined
Last Comment
Scott Pletcher

8/22/2022 - Mon