1

Can mysql-server-express compress strings? if you could give me a link to some documentation that says so it will be much appreciated as I can't seem to find this info.

I know that mysql allows this by using the compress() Function on the string. Also wondering whether this can be done automatically or do you need to use this function every time?

Also according to http://www.postgresql.org/docs/8.0/interactive/datatype-character.html - the compression is done automatically. Am I correct?

michelle
  • 2,759
  • 4
  • 31
  • 46

1 Answers1

1

PostgreSQL automatically compresses anything stored with TOAST, which it uses for large rows. This compression is transparent, so to calling code it looks like no compression has happened - reads and writes use the uncompressed form - but actually it has.

Because it's transparent, it doesn't affect queries searching through the values.

If you use myisampack with MySQL, it compresses a table, but makes it read-only. I'm not sure whether the express version allows that or not.

With any database, you can do your own compression and store the resulting blob:

Pros: Likely better than PostgreSQL's compression in many cases. Likely better than any compression that happens within the communication protocol. If your use of the data can deal with it compressed, then the work is done for you.

Cons: Requires work from your end. Ruins the ability to search within the field in question. May interfere with internal compression sub-optimally (though probably still better than not compressing in those scores where compression is a win). If your use of the data cannot deal with it compressed, then you have more work to do before accessing it.

Jon Hanna
  • 110,372
  • 10
  • 146
  • 251