PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > Lengtht of TEXT data types
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Lengtht of TEXT data types

Réponse
 
LinkBack Outils de la discussion
Vieux 02/09/2007, 18h06   #1
Renito 73
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 02/09/2007, 18h46   #2
Gary W. Smith
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h44.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06610 seconds with 10 queries