Re: Storage space usage

From: Decibel! <decibel(at)decibel(dot)org>
To: "Gangadharan S(dot)A(dot)" <gangadharan(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Storage space usage
Date: 2008-02-02 06:37:09
Message-ID: 20080202063709.GR1212@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Pavel Stehule 2008-02-03 16:02:13 slow 8.2.6 with 50 connections
Previous Message Gangadharan S.A. 2008-02-01 08:44:18 Storage space usage