Re: [GENERAL] Physical column size

2006-03-03 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > An int4 field is required to be aligned at a 4-byte boundary internally, so > there are 3 bytes wasted between tmp_A.c and tmp_A.i. If you switch the > order of the fields you should see space savings. Probably not, because the row-as-a-whole has a

Re: [GENERAL] Physical column size

2006-03-03 Thread Ragnar
On fös, 2006-03-03 at 11:03 +0100, Paul Mackay wrote: > 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 > th

Re: [GENERAL] Physical column size

2006-03-03 Thread Martijn van Oosterhout
On Fri, Mar 03, 2006 at 11:03:24AM +0100, Paul Mackay wrote: > 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

Re: [GENERAL] Physical column size

2006-03-03 Thread Peter Eisentraut
Am Freitag, 3. März 2006 11:03 schrieb Paul Mackay: > 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 > ); > The end result is that the physical size on disk used by table tmp_A is > exactly the same a

[GENERAL] Physical column size

2006-03-03 Thread Paul Mackay
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_