Re: Text(1024)
Posted by:
Rick James
Date: April 03, 2011 07:45PM
> That's a BIG waste of storage
Eh?
VARCHAR(1024) consumes 2 bytes plus just enough space to hold the string you insert.
If the string is 'abcde', the field takes only 7 bytes.
CHAR(1024), on the other hand, always occupies 1024 bytes. (Well, there are exceptions). CHAR should be used only when you know that all the values are the same length.
VARCHAR(1024) CHARSET utf8, with 10 character Chinese string will take 32 bytes of storage (2-byte length + 3 bytes per 'character').
Subject
Written By
Posted
Re: Text(1024)
April 03, 2011 07:45PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.