3

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 !

daisy
  • 22,498
  • 29
  • 129
  • 265

4 Answers4

2

InnoDB support data compression:

http://dev.mysql.com/doc/innodb-plugin/1.0/en/innodb-compression-usage.html

Moshe L
  • 1,797
  • 14
  • 19
1

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:

Enabling Compression for a Table

0

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;

0

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).

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • Your response is useful if the client and the MySQL server is on WAN, and the problem is network latency/speed, not HDD. – Moshe L Jan 01 '12 at 13:25