From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-admin@postgresql.org
Subject: Re: Space taken by Null values
Date: Thu, 29 Jan 2015 12:42:12 -0700 (MST)
Message-ID: <1422560532253-5836010.post@n5.nabble.com> (raw)
In-Reply-To: <CAPJLWJtPgQtttujOo6s3np5hvg2qPf0E-y8cnhPPw-oL=CNC4g@mail.gmail.com>
References: <CAPJLWJtPgQtttujOo6s3np5hvg2qPf0E-y8cnhPPw-oL=CNC4g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Basant Dagar wrote
> Gurus--
>
> I have big flat table with 100 columns in it. For about 40% of its data,
> 90
> columns would be null out of 100.And this table keeps growing and will
> initial have more than 100 million rows.
>
> May I know, will this impact the size in anyways as I heard nulls will
> take no or very little space in PostgreSQL unlike oracle. even for
> millions
> of rows with many columns in it. Is that true?
>
>
> And if that is not true, would you recommend to make this table into 2
> tables with the 2nd table containing those 40% records with only 10
> required columns in it?
IIRC a single null occupies one bit.
I would indeed expect to be able to create two tables and minimize or
eliminate the number of columns defined to allow NULL. If that is what you
are thinking (your question is unclear on this point) then go ahead; keeping
mind that I obviously have no clue what any of those 100 columns is...
David J.
--
View this message in context: http://postgresql.nabble.com/Space-taken-by-Null-values-tp5836008p5836010.html
Sent from the PostgreSQL - admin mailing list archive at Nabble.com.
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
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-admin@postgresql.org
Cc: david.g.johnston@gmail.com
Subject: Re: Space taken by Null values
In-Reply-To: <1422560532253-5836010.post@n5.nabble.com>
* 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