Forum Moderators: open

Message Too Old, No Replies

Puzzled About Storage Requirements for MySQL

I want to store big hunks in a DB, but not sure if I can.

         

cmarshall

4:18 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Of course, I first RTFM [dev.mysql.com], but I remain confused.

In the second paragraph, it states thusly:

The maximum size of a row in a MyISAM table is 65,534 bytes. Each BLOB and TEXT column accounts for only five to nine bytes toward this size.

Okay, fair enough. An ISAM table is max 64KB. Except that, later on, it quoth:

LONGBLOB, LONGTEXT L+4 bytes, where L < 2 to the 32nd Power (4GB).

(I annotated).

It looks like it expects to be able to store 4GB of data in the DB SOMEWHERE for each LONGBLOB data type.

Can someone explain this to me?

I know DB stored images (what I plan to do) are not so efficient, but there are very good reasons for me to do this. Namely, security and configuration management.

Can someone enlighten me on this seeming dichotomy?

coopster

4:51 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Although it may not seem obvious, it is right there in your quotation ...

Each BLOB and TEXT column accounts for only five to nine bytes toward this size.

By following the link to The BLOB and TEXT Types [dev.mysql.com] on the manual page you referenced you will find this informational note:


Each BLOB or TEXT value is represented internally by a separately allocated object. This is in contrast to all other data types, for which storage is allocated once per column when the table is opened.

Hopefully that helps clear the confusion.

cmarshall

5:43 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Duh. Thanks!