This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您可以尝试一些调整,最值得注意的是设置获取缓冲区大小。环境变量 FET_BUF_SIZE 可以设置为 32767 等值。这可能会帮助您更接近客户端和网络的饱和状态。
多个线程共享单个连接将无济于事。使用多个连接的多个线程可能会有所帮助 - 当然,它们每个都运行一个单独的查询。
如果客户端程序对行进行分组,我们必须问“为什么?”。通常最好让服务器(DBMS)来做这件事。也就是说,如果服务器受计算限制并且客户端 PC 陷入空闲周期,那么在客户端而不是服务器上完成繁重的工作可能是有意义的。只需确保最大限度地减少通过网络中继的数据即可。
There are a few tweaks you can try, most notably setting the fetch buffer size. The environment variable FET_BUF_SIZE can be set to a value such as 32767. This may help you get closer to saturating the client and the network.
Multiple threads sharing a single connection will not help. Multiple threads using multiple connections might help - they'd each be running a separate query, of course.
If the client program is grouping the rows, we have to ask "why?". It is generally best to leave the server (DBMS) to do that. That said, if the server is compute bound and the client PC is wallowing in idle cycles, it may make sense to do the grunt work on the client instead of the server. Just make sure you minimize the data to be relayed over the network.