compression - need mysql compatible compress()/decompress() for Java -


i'm thinking of applying mysql compress() function field varchar , tends run few thousand characters more million, per column. text normal english, 8-to-1 or ever better compression. since have millions of records , ever want @ data, compression seems engineering tradeoff.

i need of processing in java, , there nice implementations of zip, gzip , bzip2. cool.

but i'd love able use standard mysql client queries such as

select decompress(longcolumn) ...

so i'd java code use same, or compatible compression algorithm built in function. documentation find says "compiled compression library such zlib"

this bit vague, how can know use?

=== edited == clear, want able use "mysql" client program debugging, things like:

select decompress(longcolumn) ...

don't use java @ all. want updates , inserts using jdbc. , mainline usage, has compressed blog, , decompress it. sort of wrapper or zipinputstream fine.

i'm not certain, i'd try wrapping output inflaterinputstream():

resultset resultset = statement.executequery("select blobfield table"); inputstream stream = new inflaterinputstream(resultset.getblob(1).getbinarystream());

http://docs.oracle.com/javase/1.4.2/docs/api/java/util/zip/inflaterinputstream.html

this blogpost might interesting well: http://www.mysqlperformanceblog.com/2012/05/30/data-compression-in-innodb-for-text-and-blob-fields/


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -