Re: database design best pratice help

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: database design best pratice help
Дата
Msg-id 1359398840.88079.YahooMailNeo@web162903.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на database design best pratice help  (Jose Soares <jose.soares@sferacarta.com>)
Ответы Re: database design best pratice help  (Bob Futrelle <bob.futrelle@gmail.com>)
Список pgsql-general
Jose Soares <jose.soares@sferacarta.com> wrote:

> In my db I have about one hundred tables like this:
>
> code
> description
>
> To avoid to have a so great number of similar tables in the db
> I wonder if it is a good idea to unify all these tables in one
> big table like this:
>
> id
> code
> table_ name
> description

> Could this be a way to enhance db performance?

No.  It could easily hurt performance, and will create a mess of
your data.

> Is there any negative point that I don't see?

For starters you can't use foreign keys to ensure data integrity.

I would not only leave the separate tables, but I would create a
separate domain for the code column of each, to be used everywhere
a code is of that nature.

I recommend reading up on concepts for normalizing a relational
database.  If you mix different logical types of data in one
column, you don't even meet the requirements of first normal form,
and reduce the ability to cleanly apply relational concepts to your
data.

-Kevin



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

Предыдущее
От: Anson Abraham
Дата:
Сообщение: Re: main.log file not being updated
Следующее
От: Bob Futrelle
Дата:
Сообщение: Re: JDBC - Need to declare variables for values in insert statement