Anybody knows how MySql allocates memory for “text” and “blob” in case i’m inserting smaller data than the max size of the column ?
For example, What happens when i insert 50K string into a “text” column? Is the entire 65K column allocated ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The TEXT data type comes in four different sizes
*TINYTEXT
*TEXT
*MEDIUMTEXT
*LONGTEXT
differing in the maximum length of values they can store. All are variable-length types, so an individual value requires storage equal to the length (in characters) of the value, plus 1 to 4 bytes to record the length of the value. Trailing spaces are not removed or added for storage or retrieval.
For variable-length (VARCHAR, TEXT) columns, MySQL allocates only the required amount of space for each stored value.
i.e. For Text datatype
Number of characters+2 bytesand has Max length upto 65,535 characters