Re: Question on simulating Enum Data type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question on simulating Enum Data type
Дата
Msg-id 12537.1111207118@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Question on simulating Enum Data type  ("Morgan Kita" <mkita@verseon.com>)
Список pgsql-novice
"Morgan Kita" <mkita@verseon.com> writes:
> Hmm still I wonder, won't the varchar/char compares be much slower
> than using a seperate map table, grabbing the int value, and then only
> doing int compares?

Certainly a string compare is slower than an integer compare, but you
have to consider the context.  In database work what usually counts more
than any CPU effort is the amount of disk I/O --- and that means that
adding a table join to avoid a string compare is being penny-wise
and pound-foolish.

It'd be well worth your while to set up a few experimental comparisons
to see how this plays out in practice.  Either answer *could* be right
depending on your situation.

            regards, tom lane

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

Предыдущее
От: George Weaver
Дата:
Сообщение: Re: output a single and double quote in a string
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [despammed] Destination table by variable?