My table entry was pretty long , around 10000 characters , so i'm wondering if i need to compress that myself , e.g use gzip library , before inserting to mysql
?
Current i'm using MyISAM database format.
Thanks !
InnoDB
support data compression:
http://dev.mysql.com/doc/innodb-plugin/1.0/en/innodb-compression-usage.html
you can use the attributes ROW_FORMAT=COMPRESSED, KEY_BLOCK_SIZE
, or both in the CREATE TABLE
and ALTER TABLE
statements to enable table compression. Depending on the combination of option values, InnoDB
attempts to compress each page
For more details go through below link:
To Enable compression on table you need to follow the below steps.
1)Need to set parameter in mysqlconfig file
SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_file_format=Barracuda;
2)Need to add clauses
ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE
on create or alter table command.
you can use any of this they are optional.
ALTER TABLE node ROW_FORMAT=compressed;
The mysqlclient library may do some compression (with CLIENT_COMPRESS
flag to mysql_real_connect) to minimize network bandwidth, but AFAIK the mysqld
server program won't compress data on disk, unless asked (see Moshe's reply). And you probably don't want to search inside compressed data.
BTW, you should use InnoDB not MyISAM (which is sort-of deprecated).