Re: Question concerning arrays - Mailing list pgsql-general

From Jorge Godoy
Subject Re: Question concerning arrays
Date
Msg-id 87sllqvjyo.fsf@gmail.com
Whole thread Raw
In response to Question concerning arrays  ("Christian Rengstl" <Christian.Rengstl@klinik.uni-regensburg.de>)
List pgsql-general
"Christian Rengstl" <Christian.Rengstl@klinik.uni-regensburg.de> writes:

> 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=...

When I had a similar problem I decided on using arrays.  But in my case I'm
never going to search for individual values for every row -- after retrieving
one row I may look for some specific value, though, but then I already have
it.

I'd also like to know what would be the best design for this when it is needed
to search for individual values...

In my case I had concentration and measured values in the form of key=value
(conc=measured), both numeric and in variable quantities for each specific
test (minimum of 3, maximum of ...  I don't know :-)).

--
Jorge Godoy      <jgodoy@gmail.com>

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: auto-vacuum & Negative "anl" Values
Next
From: Franz.Rasper@izb.de
Date:
Subject: Re: RAID + PostgreSQL?