[TYPO3-dev] BLOBs considered harmful

R. van Twisk typo3 at rvt.dds.nl
Wed Jun 28 14:26:27 CEST 2006


Marc Wöhlken [quadracom] wrote:
> Martin Kutschker schrieb:
>   
>> So I suggest TYPO3 switches from Mysql type BLOB to TEXT. So other DBs
>> are not tricked into BLOBs unless really necessary.
>>     
>
> +1
>
> ... but be aware of some tricky differences between blob and text fields:
>
> [mysql manual]
> BLOB columns are treated as binary strings, whereas TEXT columns are
> treated according to their character set. For BLOB columns, sorting and
> comparison is case sensitive. For TEXT columns, values are sorted and
> compared based on the collation of the character set assigned to the
> column as of MySQL 4.1. Before 4.1, TEXT sorting and comparison are
> based on the collation of the server character set.
> [/mysql manual]
>
> if these differences do not matter it would be great to switch to text
> fields.
>   
Basically BLOB holds a comma separated list on numbers. That's all.
We cannot even sort on them. Nor you can index these 'relations'. So that
will not cause any problems. I already have converted quite a number of 
blob fields to text fields.
without a problem. It might even speedup the system a little bit on 
UTF-8 enabled databases
since no conversion will be done between binary and UTF internally in MySQL.

NOTE: Normally there is no reason to sort BLOB anyways, since it suppose 
to handle binary data, like files for example.
> CU
>  Marc
>
>
>   





More information about the TYPO3-dev mailing list