|
|
|
|
| |
PDo your values lie within some particular range? If they are integers, will they always be non-negative? If so, you can use UNSIGNED. If they are strings, will they always be chosen from among a fixed set of values? If so, you may find ENUM or SET a useful type.
There is a tradeoff between the range of a type and the amount of storage it uses. How "big" a type do you need? For numbers, you can choose small types with a limited range of values, or large types that are essentially unlimited. For strings, you can make them short or long, so you wouldn't choose CHAR(255) if all the values you want to store contain fewer than 10 characters.
What are the performance and efficiency issues? Some types can be processed more efficiently than others. Numeric operations generally can be performed more quickly than string operations. Short strings can be compared more quickly than long strings and also involve less disk overhead. For ISAM and MyISAM tables, performance is better for fixed-length types than for variable-length types.
How do you want your values to be compared? For strings, comparisons can be case sensitive or not case sensitive. You choices here also affect sorting and grouping operations, which are based on comparisons.
Do you plan to index a column? If you do, it affects your choice of table type and column type because indexing properties are not the same for all table handlers. For example, with ISAM tables, you cannot index BLOB and TEXT columns, and indexed columns must be defined as NOT NULL (which affects your ability to use NULL values).
|
|
|
|
|
|
| Link Partners: Asia florist, Flowers to India, Hong kong flowers, Site submit, Cheap web hosting, China florist, Japan florist |
|