On Fri, Sep 3, 2010 at 12:04 PM, Michael Grant <[email protected]> wrote:

>
> *bump*
>
> No one has any insight into this? Please please please.
>
> On Thu, Sep 2, 2010 at 11:47 AM, Michael Grant <[email protected]> wrote:
>
> > Normally I use MSSQL but the shop I'm at uses mySQL. I've always built my
> > db's so that the field best matches the data going into it.
> >
> > As an example if I was storing some text data that was max 1000 chars I
> > would use varchar(1000) and not a blob type. I've always thought that
> this
> > prevented bloating. However I've just been told something that
> contradicts
> > this and I'm wondering what you experts say. Is using the TEXT datatype
> > completely variable how long it it? So if I insert a single character
> into a
> > tinytext, text, mediumtext or longtext field it will only take up that
> much
> > room in the db? Is that correct?
>


It's not as simple as you think it is.  I don't know the answer for sure but
this is what I know.

Assuming mySQL...How much space something takes is dependent on the type of
engine you select.  The common ones are innodb, myISAM, and the perconaDB.
As far I remember the innodb takes more space because it has more features
and can't be compressed.

Looking at myISAM, which by the way is probably not the engine you want for
any transaction based db, you would use one (1) more bytes over a
varchar(1000).  So if storing i piece of data as a varchar(1000) that was
299 cahr longs it would take 300 bytes it would take 301 bytes if you had
typed is as a text.  That is true up to 65536 bytes.  then the storage
requirements changes.

recap: in your case if you were using myISAM the text type would use 1 more
byte than the varchar(1000).  Things like char encoding like UTF or latin
will impact it as well.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336810
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to