Re: Question concerning arrays

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Question concerning arrays
Date: 2006-06-28 10:28:34
Message-ID: 20060628102833.GA6400@merkur.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 27, 2006 at 01:43:21PM +0200, Christian Rengstl wrote:

> i am in the middle of breaking my head over designing a
> database and came to the following question/problem: i have
> persons whose values (integer) have to be entered in the db,
> but per person the amount of values ranges from 10 to
> around 50. Now my question is if it makes sense, concerning
> performance, to store these integer values in arrays or if
> it is better to change the design so that the values are
> stored separately in fields in tables. I have to add, that
> it is not unlikely (or at least it won't happen very often)
> that select queries will try to find one of those specific
> values, but rather something like select * from persons
> where person_id=...
If each value has a distinct medical meaning (think blood
sugar readings) which makes sense on its own apart from all
the other values it should very likely be stored as a
separate value in the database.

If, however, it is just one integer in a large batch of them
(think raw values of EEG readings) which only really make
sense in conjunction with each other and even then mainly to
the application they should probably be stored as arrays or
some other aggregate datatype. You might still want to query
for single values out of the batch at times - detecting
Ausreißer, fitting curves, detecting peaks of activity, etc.

Karsten

Assistenzarzt für Kinderheilkunde,
Chirurgie und Allgemeinmedizin
Leipzig
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-06-28 10:53:10 Re: UUID's as primary keys
Previous Message Thomas Hallgren 2006-06-28 10:03:40 Re: UUID's as primary keys