Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA04543; Mon, 15 Jun 92 08:59:51 -0700
Date: Mon, 15 Jun 92 08:59:51 -0700
Message-Id: <9206151559.AA04543@postgres.Berkeley.EDU>
From: musman@radar.nrl.navy.mil (Scott Musman)
Subject: internal storage???
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu


	I'm using postgres to store the signal data from many time
series from different data-collections.

	Each signal representation is a vector ranging somewhere
between 128-512 elements. One byte per element is enough to store the
information. 
	I'm storing approximately 4 vectors per sample. Postgres kept
barfing when I tried to define and store them all as a single class,
so I ended up defining them as 2 classes:

create sig_amp (
	sig_id = int4,
	samp_number = int2,
	proc_code = int2,
	real_amp = bytea[],
	im_amp = bytea[]
	)

create sig_phase (
	sig_id = int4,
        samp_number = int2,
	proc_code = int2,
	phase_ang = bytea[],
	phase_diff = bytea[]
	)


	Anyway... The purpose of this message is that after storing
some 6,000 signal entries into a database I happened to notice that
the disk storage being eaten up by this storage format is over 100 Mb.
Since I've got a few more signals to store (over 100,000) I can
easily see that I'll run out of disk space before I can store them
all.
	For the current signals I've stored, I'm only storing 256
entries per sample array. I just hand't planned for all of the extra
overhead in storing the samples into postgres and I expected to find
that I had used less than 10Mb instead of over 100 Mb.

	I need to be able to access the signal data in terms of a
couple hundred samples at a time.. 

	retrieve sample where sig_id=2332445 and samp_number is
greater than 250 but less than 550.

	Does anyone have any suggestions on how to better structure
the database, so that I'm not so greedy in using disk storage??? Any
help would be much appreciated.


		-- Scott
		musman@radar.nrl.navy.mil
