Does NULL actually acquire any bit of memory in Teradata or in anyother database?

Database

Does NULL actually acquire any bit of memory in Teradata or in anyother database?

Hi All,
Yep, I know this might sound like too easy, but I was asked this question and responded with "It does occupy". But couldn't say, how many bits, if so.

It is very well-known that NULL represents NOTHING interms of values at a column level in a database. But when we run a query in Teradata or in anyother database, we could get some letter or word to indicate it is actually NULL ( ? in Teradata, [NULL] in sybase ) . Does these indicators added on the fly and if so, how?

Could anyone explain me how many bits would it occupy, if so?
Tags (1)
2 REPLIES
Enthusiast

Re: Does NULL actually acquire any bit of memory in Teradata or in anyother database?

1. If a column is not compressed, then space is used for that column whether the value is null or not. So of the column spec is Char(20), 20 character are used by that column regardless of the value, including Null.
2. Each column in a table which is nullable has one bit allocated in the row header. (There are additional bits for compression values too.)
3. How nulls are shown by reporting tools is down to the tool, not the database. SQL Assistant shows a null as ? by default, it can be changed to another value on the Tools/ Options menu. Bteq also uses ? by default but it can be changed to any value by the .Null command. The ? character is not held within the data row on the physical database.

Re: Does NULL actually acquire any bit of memory in Teradata or in anyother database?

Thank you very much Jimm.. This info is really helpful..
~Sundar G