Re: Storage space usage - Mailing list pgsql-performance

From Decibel!
Subject Re: Storage space usage
Date
Msg-id 20080202063709.GR1212@decibel.org
Whole thread Raw
In response to Storage space usage  ("Gangadharan S.A." <gangadharan@gmail.com>)
List 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@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Attachment

pgsql-performance by date:

Previous
From: "Gangadharan S.A."
Date:
Subject: Storage space usage
Next
From: "Pavel Stehule"
Date:
Subject: slow 8.2.6 with 50 connections