Minimizing MySQL output with Compress() and by concatening results?

Posted by johnrl on Stack Overflow See other posts from Stack Overflow or by johnrl
Published on 2010-05-02T15:40:20Z Indexed on 2010/05/02 15:47 UTC
Read the original article Hit count: 140

Filed under:
|
|

Hi all. It is crucial that I transfer the least amount of data possible between server and client. Therefore I thought of using the mysql Compress() function. To get the max compression I also want to concatenate all my results in one large string (or several of max length allowed by MySql), to allow for similar results to be compressed, and then compress these/that string.

1st problem (concatenating mysql results):

SELECT name,age
FROM users

returns 10 results. I want to concatenate all these results in one strign on the form: name,age,name,age,name,age... and so on. Is this possible?

2nd problem (compressing the results from above)

When I have comstructed the concatenated string as above I want to compress it. If I do:

SELECT COMPRESS('myname');

then it just gives me as output the character '-' - sometimes it even returns unprintable characters. How do I get COMPRESS() to return a compressed printable string that I can trasnfer in ex ASCII encoding?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about compression