Re: Shall I apply normalization in the following case?

Поиск
Список
Период
Сортировка
От Lew
Тема Re: Shall I apply normalization in the following case?
Дата
Msg-id hkeo58$v71$1@news.albasani.net
обсуждение исходный текст
Ответ на Re: Shall I apply normalization in the following case?  (Sim Zacks <sim@compulab.co.il>)
Список pgsql-general
Sim Zacks wrote:
> 2) querying on an int is quicker then querying on a string, so if you
> query on the values without the join you will have better performance.

The point of Jorge's approach is that it allows a query without a join.

With the OP's normalization, using integer keys, a join was required,
obviating any advantage to the integer key.

The assertion that a query involving integer keys is always faster than one
with string keys is unsafe at best.  The first rule of performance
optimization is that optimizations don't.

You have to test and measure to find out when and if they do.

Misuse of surrogate keys to obtain optimization is a prime example.  I've seen
situations in the field several times when such abuse forces extra joins in
queries and an increase in the number of indexes to maintain.  Without
measurement under representative workloads, especially concurrent activity,
it's impossible to know whether the cost outweighs the benefit.

--
Lew

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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Postgres wal shipping from 8.33 to 8.42.
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Postgres wal shipping from 8.33 to 8.42.