X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id D5ED09DC9D7 for ; Fri, 3 Mar 2006 06:03:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 16374-06 for ; Fri, 3 Mar 2006 06:03:25 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.203]) by postgresql.org (Postfix) with ESMTP id D179A9DC887 for ; Fri, 3 Mar 2006 06:03:21 -0400 (AST) Received: by xproxy.gmail.com with SMTP id s18so411990wxc for ; Fri, 03 Mar 2006 02:03:24 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=BylVBjDmFS8zRApeZ8eV5XdXAV8MKHxGoxuufza3fza4xUtX7YPyb5SBlZc0pUW2X0YbQWIaH4Oqe/6UQ17a2guFsBz4kV8uKIdbvX+1npgLEeOuNsJOKcb6d3vo2PbfNotaUPU9E+O66it8mNs+koGgv01Z9lDyGpd+Uzf06+o= Received: by 10.70.88.17 with SMTP id l17mr4249922wxb; Fri, 03 Mar 2006 02:03:24 -0800 (PST) Received: by 10.70.37.15 with HTTP; Fri, 3 Mar 2006 02:03:24 -0800 (PST) Message-ID: <786c2f6d0603030203m3b7c62a1k6950ceca066dc5ce@mail.gmail.com> Date: Fri, 3 Mar 2006 11:03:24 +0100 From: "Paul Mackay" To: pgsql-general@postgresql.org Subject: Physical column size In-Reply-To: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21127_10052738.1141380204291" References: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.567 required=5 tests=[AWL=0.566, HTML_MESSAGE=0.001] X-Spam-Score: 0.567 X-Spam-Level: X-Archive-Number: 200603/111 X-Sequence-Number: 91976 ------=_Part_21127_10052738.1141380204291 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 inserted 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 ------=_Part_21127_10052738.1141380204291 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 inserted a bit more than 19 million rows in= each table (exactly the same number of rows in each).=20

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 f= unction) ! 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 st= ored ?=20

Thanks,
= Paul
------=_Part_21127_10052738.1141380204291--