List:General Discussion« Previous MessageNext Message »
From:Robert Dunlop Date:April 16 2005 9:38pm
Subject:Re: Size of BLOB types?
View as plain text  
>...my question is what are the maximum
>sizes (in characters) of each of the BLOB / TEXT types,
    I assume the reason the sizes are not given in characters is that these
are binary fields - it's in bits because that's what relevant to binary
data.

>and why isn't that
>information on the manual page for BLOB / TEXT types.
    For that you'd have to ask MySQL.

As to why there's a "TINY" - again I'm assuming, but I'd expect if someone
has a lot of small binary data elements to store, they wouldn't necessarily
want to waste 1K, or 65K of disk space for each element.  Just because you
have no use for it doesn't mean others don't.  My experience with most DB
software is that it's driven by requirements, not whim.


----- Original Message ----- 
From: "Dan Bolser" <dmb@stripped>
To: "Robert Dunlop" <rdunlopconsult@stripped>
Cc: "Hassan Schroeder" <hassan@stripped>; <mysql@stripped>
Sent: Saturday, April 16, 2005 2:22 PM
Subject: Re: Size of BLOB types?


On Sat, 16 Apr 2005, Robert Dunlop wrote:

>Your question was would a TINYBLOB hold 1,000 characters.
>TINYBLOB (TINYTEXT) = 257 characters.  1,000 > 257 = No.
>Your next option, BLOB (TEXT) = 64K.  1,000 < 64K = Yes.

Yeah, I got that part, more generally my question is what are the maximum
sizes (in characters) of each of the BLOB / TEXT types, and why isn't that
information on the manual page for BLOB / TEXT types.

Another question comes to mind, which is why is TINYTEXT so useless?

A VARHCAR(255) is nearly as good! I would have thought any datatype with
BLOB in its name would have the self respect to hold at least 65536
characters!

Thanks for the pointers so far,
Dan.



>
>----- Original Message ----- 
>From: "Dan Bolser" <dmb@stripped>
>To: "Hassan Schroeder" <hassan@stripped>
>Cc: <mysql@stripped>
>Sent: Saturday, April 16, 2005 1:49 PM
>Subject: Re: Size of BLOB types?
>
>
>On Sat, 16 Apr 2005, Hassan Schroeder wrote:
>
>>Dan Bolser wrote:
>>> The manual dosn't specify the maximum number of characters in the
>>>
>>> TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT data types.
>>>
>>> http://dev.mysql.com/doc/mysql/en/blob.html
>>>
>>> Are these valid synonyms, TINYBLOB, MEDIUMBLOB and LONGBLOB?
>>
>>The very beginning of the cited page is:
>>
>><q>
>>  A BLOB is a binary large object that can hold a variable amount of
>>  data. The four BLOB types, TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB,
>>  differ only in the maximum length of the values they can hold.
>>
>>  See Section 11.5, â?oColumn Type Storage Requirementsâ?.
>>
>>  The four TEXT types, TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT,
>>  correspond to the four BLOB types and have the same maximum lengths
>>  and storage requirements.
>></q>
>>
>>And if you follow that link to Section 11.5, you'll find the size
>>of all of the above, and the answer to your question:
>>
>>> I have a field with just under 1000 characters, am I OK with a TINYTEXT?
>>
>>:: which is "nope" :-)
>>
>>FWIW!
>
>FWIW?
>
>Naturally I followed that link, but was unable to understand (or piece
>together) the information there in.
>
>Storage Requirements for String Types:
>(or maximum length of BLOB types for dummies)
>
>TINYBLOB   (or TINYTEXT)   = 1+(2^ 8) =        257 characters
>BLOB       (or TEXT)       = 2+(2^16) =      65538 characters
>MEDIUMBLOB (or MEDIUMTEXT) = 3+(2^24) =   16777219 characters
>LONGBLOB   (or LONGTEXT)   = 4+(2^32) = 4294967300 characters
>
>Does that answer my question?
>
>I think it does, but I am not sure. Seems strange not to have this
>information at the very begining of the cited page.
>
>
>
>


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=1


Thread
Size of BLOB types?Dan Bolser16 Apr
  • Re: Size of BLOB types?Hassan Schroeder16 Apr
    • Re: Size of BLOB types?Dan Bolser16 Apr
      • Re: Size of BLOB types?Robert Dunlop16 Apr
        • Re: Size of BLOB types?Dan Bolser16 Apr
          • Re: Size of BLOB types?Robert Dunlop16 Apr
      • Re: Size of BLOB types?Hassan Schroeder16 Apr
  • Re: Size of BLOB types?Dan Nelson17 Apr
    • Re: Size of BLOB types?Dan Bolser17 Apr