Re: Need help to organize database

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: Need help to organize database
Дата
Msg-id 20041221220025.GA17044@wolff.to
обсуждение исходный текст
Ответ на Re: Need help to organize database  ("Vladimir S. Petukhov" <vladimir@sycore.org>)
Ответы Re: Need help to organize database
Список pgsql-general
On Wed, Dec 22, 2004 at 00:16:06 +0000,
  "Vladimir S. Petukhov" <vladimir@sycore.org> wrote:
> On Tuesday 21 December 2004 21:21, Bruno Wolff III wrote:
> > On Tue, Dec 21, 2004 at 20:47:31 +0000,
> >
> >   "Vladimir S. Petukhov" <vladimir@sycore.org> wrote:
> > > Ok, this is a real example:
> > >
> > > CREATE TABLE account (
> > >   val1     BIGINT      NULL,
> > >   val2    BIGINT      NULL,
> > >  ...
> > >
> > >   daypos    SMALLINT    NULL,   -- Day position
> > >   hourpos   SMALLINT    NULL,   -- Hour position
> > >   id        INT         NULL  -- Link to the object
> > > );
> >
> > That approach is reasonable but depending on what the val* columns mean
> > you might each of those as a separate role. You didn't add a lot of
> > information, but that they appear to be the same type suggests that you
> > might want one row per value. But without knowing what they mean it is
> > hard to say.
>
> OK, i want to store ststistic information, ingoing/outgoing traffic,
> ingoing/outgoing errors(val1-val4) for example...

Those sound like different domains then for each column. So you probably do
want to keep the 8 values in one row.
I also noticed that you marked a lot of these values as NULL. I think that
daypos, hourpos and id form the primary key and you probably don't want to
allow NULLs for these.

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: PostgreSQL training curriculum
Следующее
От: Doug Quale
Дата:
Сообщение: Re: PostgreSQL training curriculum