1
votes

In Amazon Redshift, how are nulls stored? - will they take up physical space?

I'm looking to see how best to design a table - the data behind it may mean it will have many columns that are sparsely populated and so I would like to know if this has a negative impact (even after compression) or if nulls don't actually take up any space at all (for example like v5.0.3 or later in mysql)

thank you

1

1 Answers

2
votes

Yes, columns with lots of nulls will provide excellent compression, and consequently great performance on Amazon Redshift.

Amazon Redshift is a columnar database engine. Columnar database are greatly optimized for data with repeating values, and those can be null.

So if you have a table where some of the columns have lots of nulls, this will more than likely compress extremely well, and provide savings in storage as well as processing speeds.

In order to achieve the proper compression you have two options:

  1. DDL Design - Manually choose your encoding settings.
  2. Automatic - Have the copy command automatically choose the optimal encoding settings for your database.