Menu

#1246 DB design hint: too much TEXT columns

open
nobody
None
Normal
2015-02-15
2010-07-04
Anonymous
No

Problem:
In case of too many TEXT/BLOB columns in a table, a data insert could end up on error 139.
The number of columns could be as low as 10! *)
http://bugs.mysql.com/bug.php?id=1611
http://bugs.mysql.com/bug.php?id=10035

Conditions: any version of MySQL (mine is 5.1.30)
limit depends on storage engine (InnoDB is affected more)

Proposal:
PMA will issue a warning on table page about this little known restriction. User is aware and could do prevent it in early stage of db design, or before production use hits that.

*) for InnoDB. 768 chars is used one utf8 TEXT field - that means 7680 chars for 10 such fields - add few other fields and you hit the limit 8000 chars (half of database page). Ten TEXT fields are ok in circumstances when some of the values are NULL or we don't use utf8 (then limit raises to cca 15 fields).
for MyISAM is similar limit higher, at cca 85 fields. http://bugs.mysql.com/bug.php?id=21101#c80978

Such behavior of PMA would be a lifesaver for most people that don't know that such limit exists and later could save them database redesign need.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.