pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Mackay <mackaypaul@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Physical column size
Date: Thu, 26 Jan 2006 11:06:24 +0100
Message-ID: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com> (raw)

Hi,

I've created a table like this :
CREATE TABLE tmp_A (
c "char",
i int4
);

And another one
CREATE TABLE tmp_B (
i int4,
ii int4
);

I then inerted a bit more than 19 million rows in each table (exactly the
same number of rows in each).

The end result is that the physical size on disk used by table tmp_A is
exactly the same as table tmp_B (as revealed by the pg_relation_size
function) ! Given that a "char" field is supposed to be 1 byte in size and a
int4 4 bytes, shouldn't the tmp_A use a smaller disk space ? Or is it that
any value, whatever the type, requires at least 4 bytes to be stored ?

Thanks,
Paul

view thread (7+ messages)  latest in thread

Message-ID: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com>
Permalink:  ../786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com/
Also on:    postgresql.org/message-id/786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com

 · 

reply

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-sql@postgresql.org
  Cc: mackaypaul@gmail.com, pgsql-performance@postgresql.org
  Subject: Re: Physical column size
  In-Reply-To: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.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