MySQL中是否有一个函数可以压缩查询返回的结果?

问题描述:

如果结果达到一定的行数,我想压缩结果.

I would like to compress the results if it reached a certain number of rows.

然后,客户端程序将解压缩结果和过程.

The client program would then uncompress the result and process.

这是具有客户端/服务器体系结构的桌面,某些客户端通过vpn连接.

This a desktop with a client/server architecture, some clients connects through vpn.

当客户端连接时,它将向服务器发送数据.服务器完成处理后,客户端将从服务器下载更新的数据.

When a client connects, it will send data to the server. After the server has done processing, the client will then download updated data from the server.

客户位于几个城镇,平均50-100公里.离开.他们将使用vpn通过Internet连接.但这是使用vpn或其他方式实施的最初计划,尚未实施.

The clients are located in several towns, with average of 50-100 kms. away. They will connect through internet using vpn. But that is the initial plan, not implemented yet, using vpn or other means.

There is the COMPRESS function which can be used to compress strings into binary strings. However, depending on your needs that may not really address the problem especially since database records are usually already very compact by their very nature so I'm not certain how much benefit you'll receive from attempting further compression of the result set.

您需要注意的一件事是过早的优化.如果您尝试在正确识别实际瓶颈之前进行优化,而不只是盲目地射击可能的瓶颈,通常可能会引入不必要的复杂性并实际上损害性能.

One thing you need to be careful of is premature optimization. Oftentimes you can introduce unneeded complexity and actually hurt performance if you attempt to optimize prior to correctly identifying actual bottlenecks and not just shooting blindly at the possible ones.

以这种方式,我想问一下您是否确实在应用程序中发现了瓶颈?如果是这样,它到底在哪里,它的本质是什么?您在什么环境工作?该Web开发或具有客户端/服务器体系结构的桌面吗?

In that vein I would ask if you have actually identified a bottleneck in your application? If so, where exactly is it and what is its nature? What environment are you working in? Is this web development or desktop with a client/server architecture?

也许您可以将一些其他信息添加到您的问题中,然后才能更好地为您提供帮助?

Perhaps you can add some of this additional information to your question and then it would be possible to better assist you?