From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | nazgul <nazgul(at)punkass(dot)spam>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: size of NULL field? |
Date: | 2002-04-15 19:33:29 |
Message-ID: | 200204151933.g3FJXT912721@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Tom Lane wrote:
> nazgul(at)punkass(dot)spam (nazgul) writes:
> > Hi, I'm wondering how much storage space a NULL value takes up?
>
> None.
>
> However, as soon as you have any NULLs in a particular table row, the
> row needs to store a NULL-value bitmap, which has one bit per table
> column to show which ones are nulls. So you could say that the first
> NULL in a given row costs you 4 bytes (more if you have > 32 columns).
> Additional NULLs in the row are free.
Oh, I didn't realize the size of the NULL bitmask was zero if no nulls
exist. Nice.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | PG Explorer | 2002-04-15 19:35:29 | Re: using CAST and LIKE |
Previous Message | Neil Conway | 2002-04-15 19:24:38 | Re: string encryption |