Search code examples
databaseoraclerelational-databaseentity-relationship

Will blank fields (i.e. columns) in Oracle table still eat disk space?


For example, I have the following employee table:

emp_id - name - address

1234 ---- alex ---- (null)

1235 -----john ---- (null)

Notice that I did not put anything in the address column.

Will the address column still consume disk space even if I didn't put anything to it?

I ask this question because I am planning the delete some columns in a particular table. This table has about fifty (50) columns but only fifteen (15) columns are being used. I need to find out if the other thirty-five (35) columns (which are not being used) are still taking up disk space even if you didn't put anything on it.

Your response is highly appreciated.


Solution

  • From the section about table storage in the Concepts Guide

    "Nulls are stored in the database if they fall between columns with data values. In these cases, they require 1 byte to store the length of the column (zero). Trailing nulls in a row require no storage..."

    So in the precise case you posted in your question the answer would be that the address column doesn't take up any space. But other columns with nulls might.