From: Decibel! <decibel@decibel.org>
To: Gangadharan S.A. <gangadharan@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Storage space usage
Date: Sat, 2 Feb 2008 00:37:09 -0600
Message-ID: <20080202063709.GR1212@decibel.org> (raw)
In-Reply-To: <e36d60c10802010044o40143aaybcbbfa223d289a35@mail.gmail.com>
References: <e36d60c10802010044o40143aaybcbbfa223d289a35@mail.gmail.com>
On Fri, Feb 01, 2008 at 02:14:18PM +0530, Gangadharan S.A. wrote:
> Hi,
> I have 2 questions regarding the storage optimization done by Postgres:
> 1) Is a NULL value optimized for storage. If I have a timestamp (or some
> such) field that I set to default NULL, will it still use up the full space
> for the data type.
Null values are indicated via a NULL bitmap. A null field is not stored,
it is just indicated in the bitmap.
> 2) Similarly, if I have a text array, is an empty array optimized for
> storage?
Arrays are stored as varlenas. I'm pretty sure than an empty array is
considered to be NULL; as such the comments above would apply.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: decibel@decibel.org, gangadharan@gmail.com
Subject: Re: Storage space usage
In-Reply-To: <20080202063709.GR1212@decibel.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox