Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>>I am merging two tables. Each one contains data on documents contained in a library. The first uses character fields for most of its data types but does have 2 memo fields. The second uses memo fields (5) for most of its columns. The second table is the smaller of the two (about 1/3 the records of the first). Assuming the data in the second table's memo fields can be contained in character fields 255 wide, would the best choice be to continue using memo fields in the combined table or to convert the memo fields to character fields to match the first table? The combined number of records is fairly small (6000) so disk space is not much of an issue. The application will be webbased.
>>
>>What would you recommend regarding pros and cons either way?
>>
>>Thanks
>
>On top of my heads:
>Pros:
>Char fields can be used in INDEX (memo also but with some transformation).
>Char fields could be used in GROUP BY in SELECT, can be exported with COPY TO ... EXPORT commands.
>There is no MEMO bloat when using char field.
>
>Cons:
>You can't store more than 254 bites in char field, as Sergey already mention it.
>Bigger table size even if you store 1 char into the field.
>
>I always prefer to use Char (and new varchar) type when I can.
Thanks Borislav,
I have never use varchar. Is it fair to say the primary difference between it and Character type is the absense of padding to the full field width? Does the byte cost vary with the actual contents of the field?
Does varchar width establish the maxlength of the field contants?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement