| От | Tom Lane |
|---|---|
| Тема | Re: Question on simulating Enum Data type |
| Дата | |
| Msg-id | 484.1111114695@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Question on simulating Enum Data type ("Morgan Kita" <mkita@verseon.com>) |
| Список | pgsql-novice |
"Morgan Kita" <mkita@verseon.com> writes:
> However, I am a little concerned about performance in that case. If I
> use domain constraints and keep the choices as strings then a string
> comparison will be done whenver I query on this field right?
Hm? A domain constraint would cost cycles when storing into the table,
but not when querying it. Joining to another table, on the other hand,
will cost you during queries.
If the strings are long, so that the amount of extra space involved adds
up to a lot, it'd probably make sense to go with integer codes. But if
they're just a word or so then I'd lean to keeping it simple.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера