Unix Technical Forum

Lengtht of TEXT data types

This is a discussion on Lengtht of TEXT data types within the MySQL General forum forums, part of the MySQL category; --> Hello list I have doubt on TEXT data types... Checking my notes I see these ones: TINYTEXT/TINYBLOB (2^8) 255 ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:00 AM
Renito 73
 
Posts: n/a
Default Lengtht of TEXT data types

Hello list

I have doubt on TEXT data types... Checking my notes I see these ones:

TINYTEXT/TINYBLOB (2^8) 255 chars
TEXT/BLOB (2^16) 64K chars
MEDIUMTEXT/MEDIUMBLOB (2^24) 16M chars
LONGTEXT/LONGBLOB (2^32) chars

Well, my doubt consist on this... are these FIXED lengths for the text fields
or they have variable length that may grow up to that as maximum?

I require to store messages of variable length from 1 to 1024 characters, so
TINYTEXT is too short and TEXT is too large, so I want to know if it they
have variable length analog to the VARCHAR type and the client program only
ensures the messages to have 1024 length...

Thanks for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:00 AM
Gary W. Smith
 
Posts: n/a
Default RE: Lengtht of TEXT data types

> Hello list
>
> I have doubt on TEXT data types... Checking my notes I see these ones:
>
> TINYTEXT/TINYBLOB (2^8) 255 chars
> TEXT/BLOB (2^16) 64K chars
> MEDIUMTEXT/MEDIUMBLOB (2^24) 16M chars
> LONGTEXT/LONGBLOB (2^32) chars
>
> Well, my doubt consist on this... are these FIXED lengths for the text
> fields
> or they have variable length that may grow up to that as maximum?
>
> I require to store messages of variable length from 1 to 1024
> characters, so
> TINYTEXT is too short and TEXT is too large, so I want to know if it
> they
> have variable length analog to the VARCHAR type and the client program
> only
> ensures the messages to have 1024 length...


They are variable length. I believe they are assigned by blocks (disk
chucks, I believe), but I could be wrong on that part.

But in your case, you are safe using TEXT/BLOB. If you only store 1
byte, it's only taking 1 byte (plus a couple bytes overhead for the text
field). This is all covered somewhere on the MySQL site. Do a google
search on "mysql data type size" and you should find some additional
information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com