| От | Gregory Stark |
|---|---|
| Тема | Re: Char vs SmallInt |
| Дата | |
| Msg-id | 87ps2m6tk0.fsf@oxford.xeocode.com обсуждение исходный текст |
| Ответ на | Char vs SmallInt ("Pg Coder" <pgcoder@gmail.com>) |
| Список | pgsql-general |
"Pg Coder" <pgcoder@gmail.com> writes: > Which data type is smaller and will lead to better query performance - > smallint or char? smallint is 2 bytes, usually with 2-byte alignment. If you declare a column as char it means CHAR(1) which in 8.2 is 5-8 bytes (5 bytes if it's an ascii character) and has 4-byte alignment. In 8.3 it's 2-5 bytes (2 bytes if it's an ascii character) and has 1-byte alignment. If you declare a column as "char" with the quotes then it's a 1-byte integer with 1-byte alignment. That'll be smaller than smallint. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера