X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 00E309DC880 for ; Thu, 26 Jan 2006 06:06: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 47883-10 for ; Thu, 26 Jan 2006 06:06:25 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.204]) by postgresql.org (Postfix) with ESMTP id F22759DC871 for ; Thu, 26 Jan 2006 06:06:21 -0400 (AST) Received: by xproxy.gmail.com with SMTP id s14so201247wxc for ; Thu, 26 Jan 2006 02:06: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:mime-version:content-type; b=UzUV/ghGH8p8iARcqV3zjcJY0HJBBNe9irFk7iHtV/zGdKfZo45IEEXMiOeybD1jftdtPzNesOcusBgkSvVJvQi6UWffQdC92ZxThrnerckn+AWXippjXBUtkDYqKQadH9Clm58jHX7Fyu4rxriPzky4p+VU153tpxgN9xiS9gg= Received: by 10.70.17.13 with SMTP id 13mr1965932wxq; Thu, 26 Jan 2006 02:06:24 -0800 (PST) Received: by 10.70.37.19 with HTTP; Thu, 26 Jan 2006 02:06:24 -0800 (PST) Message-ID: <786c2f6d0601260206k2201a548p48af7c7fc085d3b2@mail.gmail.com> Date: Thu, 26 Jan 2006 11:06:24 +0100 From: Paul Mackay To: pgsql-performance@postgresql.org Subject: Physical column size MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_37670_2165376.1138269984348" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.946 required=5 tests=[HTML_10_20=0.945, HTML_MESSAGE=0.001] X-Spam-Score: 0.946 X-Spam-Level: X-Archive-Number: 200601/435 X-Sequence-Number: 16913 ------=_Part_37670_2165376.1138269984348 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 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 ------=_Part_37670_2165376.1138269984348 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 &= quot;char",
i int4
);

And another one
CREATE TABLE tm= p_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).=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_37670_2165376.1138269984348--