Correction: datatypes are not "faster"
От | Josh Berkus |
---|---|
Тема | Correction: datatypes are not "faster" |
Дата | |
Msg-id | 4C80208B.4060908@agliodbs.com обсуждение исходный текст |
Ответы |
Re: Correction: datatypes are not "faster"
|
Список | pgsql-docs |
All, This is currently in: http://www.postgresql.org/docs/current/interactive/datatype-numeric.html#DATATYPE-INT "The type integer is the common choice, as it offers the best balance between range, storage size, and performance. The smallint type is generally only used if disk space is at a premium. The bigint type should only be used if the integer range is insufficient, because the latter is definitely faster." This paragraph leaves a *lot* to be desired from an accuracy perspective and encourages useless byte-counting by amateur performance geeks. Instead: The integer type is the most common choice, as it covers a sufficient range for most operations requiring a non-decimal numeric value. If, however, you think you will want to store numbers greater than 2.4 billion, then use bigint. Note that bigint will require more storage space and memory. When you have several integer columns in the same table with values less than 32,000, you can sometimes achieve significant space savings by using smallint instead of integer. Otherwise, using smallint usually results in no real space or memory savings. -- -- Josh Berkus PostgreSQL Experts Inc. http://www.pgexperts.com
В списке pgsql-docs по дате отправления: