Skip site navigation (1) Skip section navigation (2)

space usage of NULL fields

From: Jan Vicherek <honza(at)ied(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: space usage of NULL fields
Date: 1998-12-27 03:36:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

    a quick question (I couldn't contact, so I didn't check
the FAQ, but I doubt it would be there.)

   When I create a table with field "nnn float8" and total row size, say
140 bytes, and then I insert a row with NULL in this field, will my record
take up those 8 bytes in physical page (say 140 bytes) or will it take up
less (like 140-8=132), i.e. will it be shortened by those 8 bytes, since
the value is NULL and no information is stored in that field ? ( I *hate*
run-on sentences :)

   In general, what are the savings/overheads associated in PG with
NULL/not NULL fields ? I.e. if will I save the space if I define the field
as varchar(8) instead of float8  ?



 -- Gospel of Jesus is the saving power of God for all who believe --
                ## To some, nothing is impossible. ##


pgsql-hackers by date

Next:From: Angelos KarageorgiouDate: 1998-12-27 10:38:24
Subject: Re: [HACKERS] psql \d does not work
Previous:From: Bruce MomjianDate: 1998-12-26 20:10:13
Subject: Re: [HACKERS] Re: [PATCHES] NetBSD/m68k port

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group