Last post Aug 29, 2018 05:11 PM by Lannie
Aug 29, 2018 06:21 AM|kengkit|LINK
Hi guys.. i have a table which contained 653 rows in it only. Is it normal if the table size is 46.4 MiB
Any idea to decrease the table size? TQ
CREATE TABLE `product_detail` (
`PID` char(5) NOT NULL,
`promoText` char(255) DEFAULT NULL,
`desc1` text NOT NULL,
`desc2` text NOT NULL,
`desc3` text NOT NULL,
`desc4` text NOT NULL,
`desc5` text NOT NULL,
`desc6` text NOT NULL,
PRIMARY KEY (`PID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Aug 29, 2018 07:11 AM|PatriceSc|LINK
Not using MySQL but TEXT can often go up to 2 Gb of text so it likekly depends on your data. You could try the LENGTH function to check which rows have long descriptions.
Edit: or this ia question about https://dev.mysql.com/doc/refman/5.6/en/innodb-compression.html ?
Aug 29, 2018 05:11 PM|Lannie|LINK
Examine column contents.
Has the data been trimmed of excess white space?
If not you can rebuild the table with left and right trim, and if there is internal white space within free text, write regular expression sql to reduce white space to one space between words.
But look at the front end collecting all this free text. they should be cleaning the data before loading into the database table with data validation phase.