MySQL has a lot of string data types -
CHAR,
VARCHAR,
BLOB,
TEXT,
ENUM and bunch of variants such as
VARBINARY but I think it is not enough
I would also like to see type
HEXCHAR which would be able to store hex strings, such as those returned as
MD5() and
SHA1() efficiently. With little modification it could work for
UUID() as well (it adds some dashes). Currently it is quite inconvenient to deal with strings like that in MySQL. Either you store them as strings and waste space or you spend them as binary and deal with inconvenience of having not readable strings in the table OR adding
UNHEX() everywhere - which also adds overhead.
Another one I would like to see is
zBLOB or
zTEXT (or call them BLOB COMPRESSED/ TEXT COMPRESSED) which would transparently compress the blobs when they are inserted and retrieved from the database - this would allow to avoid having
COMPRESS()/
UNCOMPRESS() everywhere which clobbers things or compressing/uncompressing on the client.
It would be best if last one is optimized so if BLOB is not used in any WHERE clause (HAVING, GROUP BY etc) you could actually transparently decompress it on the client and compress bad. Though this is likely to require more significant changes in MySQL so I would not expect to happen quickly. The basic support should not be that hard though.
Entry posted by peter |
9 comments
Add to:

|

|

|

|
Idea: Couple of more string types - Read More...