Re: Table design issue....

Поиск
Список
Период
Сортировка
От pierre@kahuna.versions.com
Тема Re: Table design issue....
Дата
Msg-id 20010611172803.16790.qmail@kahuna.versions.com
обсуждение исходный текст
Ответ на Re: Table design issue....  (Alex Pilosov <alex@pilosoft.com>)
Список pgsql-sql
Unfortunately I cannot give out the full reasons behind attempting
a design such as this, however let me try and give a generalization.

What I need is a way to store different sets of data that are related
by a key in different tables. Within each table's set of columns
there will exist one attribute who is of a special type. The key is
of special interest because it helps define a grouping of rows
from within each of the tables as well as across the tables.

Now,  this special attribute's value must be unique within the grouping
that contains the row which has the attribute.

In answer to your question about seperate tables, I believe it will
be easier to maintain these data sets if they are within different
tables, both for insert as well as updates. Also I'm a bit concerned
about tuple size limitations, I could very well see 400+ columns if
I put everything into a single table.

Does this help?

 Pierre

>
> Yes, this seems like a bad design. If you feel you need to join
> potentially unlimited number of tables, that means all of those tables
> really belong in one table. If you can explain why do you think you need
> separate tables...?
>
>
>
> On 11 Jun 2001 pierre@kahuna.versions.com wrote:
>
> > Hi all,
> >
> >   I've got a situation where I need to be able to query for the
> > same sort of data across multiple tables. Let me give some example
> > tables then explain.
> >
> > create table t1 (
> >   t_attr1 text[],
> >   t_attr2 text[]
> > );
> > create table a1 (
> >   a_attr1 text[],
> >   a_attr2 text[]
> > );
> > create table c1 (
> >   c_attr1 text[],
> >   c_attr2 text[],
> >   c_attr3 text[]
> > );
> >
> > In each of the above tables *_attr*[1] contains a flag that determines
> > what type of attribute it is.
> > t1.t_attr1[1] == a1.a_attr2[1] == c1_.c_attr3[1] == FLAG
> > In otherwords, the attribute with the specific flag in quesiton is not
> > known at runtime, unless I keep a table with the column names and table
> > names setup. Also, new *1 tables could be created dynamically with new attr*'s,
> > and the number of columns within the tables isn't going to be the same.
> >
> > What I need to be able to do is say something like:
> > "For ALL *1 tables with *_attr*[1] == FLAG return rows with
> > VALUE"
> >
> > Ideas? Comments? Suggestions? Am I being crazy?
> >
> > Pierre
> >
> >
>
>

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

Предыдущее
От: Alex Pilosov
Дата:
Сообщение: Re: finding a maximum or minimum sum
Следующее
От: "Michael Richards"
Дата:
Сообщение: Re: finding a maximum or minimum sum