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

Re: cast bytea to double precision[]

From: Mathieu Dubois <mathieu(dot)dubois(at)limsi(dot)fr>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: cast bytea to double precision[]
Date: 2011-07-27 09:06:43
Message-ID: 4E2FD523.6010400@limsi.fr (view raw or flat)
Thread:
Lists: pgsql-novice
Hello,

This morning I conducted a simple test: I generated 10 000 samples of 
100-dimensional data (uniformly distributed in [-10 000; 10 000]) and 
inserted them into 2 newly created bases with only 1 table each. In one 
case the table has a bytea column (table OID 2102835) on the other a 
double precision[] (table OID 2102836). I generated scripts to insert 
the data in the 2 formats.

After insertion, 'du -h' gives:
22M    ./2102835
15M    ./2102836

So the double precision[] is really smaller.

I guess that in my case (altering column) there may be some kind of 
cache or maybe the toast table... It's really puzzling.

Mathieu
On 07/26/2011 09:19 PM, Merlin Moncure wrote:
> On Tue, Jul 26, 2011 at 2:02 PM, Mathieu Dubois<mathieu(dot)dubois(at)limsi(dot)fr>  wrote:
>> Are you sure that the length of each element is stored?
> no, I was wrong (I just checked the code) -- see CopyArrayEls. Null
> indicator is stored in a bitmap. hm.
>
> merlin
>


In response to

pgsql-novice by date

Next:From: SovietDate: 2011-07-29 17:57:57
Subject: PostgreSQL on Amazon EC2/EBS
Previous:From: David Alexander KroisDate: 2011-07-27 08:53:12
Subject: Orphaned files in the subdirectory of the database

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