On Wed, Jun 26, 2013 at 3:35 PM, Greg Keogh <g...@mira.net> wrote: > Folks, I'm loading hundreds of thousands of logging lines into a SQL > Server table and I noticed that one of the columns contains only short > words taken from a handful of choices. So the column reads like FOO FOO FOO > FOO BAR FOO FOO FOO FOO BAR BANG FOO FOO FOO etc. The column will rarely be > used. > > Would SQL boffins in here consider turning this column into something more > space saving, like a single byte flag for example? Perhaps to save space or > improve performance. >
A packed/encoded format will use less space - but whether it is worth doing depends on your app and the rest of the table (i.e. if it is 5000 bytes per row then saving a few dozen in one field isn't going to make much difference). If the column is rarely used then you will rarely see a performance difference. Unless you're writing a very high throughput system, I would value readability / maintainability over absolute performance or storage space. David.