Re: Need help to organize database

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Vladimir S(dot) Petukhov" <vladimir(at)sycore(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Need help to organize database
Date: 2004-12-21 14:38:42
Message-ID: 20041221143842.GA8895@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 20, 2004 at 12:13:31 +0000,
"Vladimir S. Petukhov" <vladimir(at)sycore(dot)org> wrote:
> Hi
> Sorry for my English..
>
> I need to organize database structure for saving statistic data for objects. I
> have about 24 * 31 * 4 fields (4 month, 31 days, 24 hours) of data for one
> object. Each field contain 8 numbers (N in general). So:
> object1 -> data -> field1, field2,...
> object2 -> data -> field1, field2,...
> ...
> How can I store this data in postgres database?
>
> For example it may be 24 * 31 * 4 * 8 fields and 1 row per object in table -
> but it is not good idea, of course.
>
> Or may be 8 fields and 24 * 31 * 4 rows per object in table, but table looked
> very big...

You want to store rows with an object id, a field or fields storing the
hour and the 8 object fields (assuming these fields shouldn't also
be one per row - but without any more knowledge about them I can't say).
You should put a primary key constraint on the object id and the hour field(s).

>
> Or may be it's not good idea to use postgres for this purpose?

Without seeing what you are going to do with the data it is hard to say
if using a dbms is overkill or not.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-12-21 14:44:27 Re: Create a cache DB between web portal and internal DB?
Previous Message Frank D. Engel, Jr. 2004-12-21 14:34:18 Re: Create a cache DB between web portal and internal DB?