PHP中的并行MySQL查询? [英] Parallel mysql queries in php?
本文介绍了PHP中的并行MySQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将数据分片到多个mysql数据库中,但是有时我需要从多个分片中收集信息.如何在php中并行查询多个mysql数据库?
I am sharding my data into multiple mysql databases, but sometimes I will need to gather information from multiple shards. How can I query multiple mysql databases in parallel in php?
我已经看到了异步curl请求和shell_exec的一些示例,但是还有更直接的方法吗?
I've seen some examples of asynchronous curl requests and shell_exec, but is there a more direct way?
推荐答案
新的mysqlnd驱动程序可以执行异步查询.文档很少,但是在演示文稿中有一些示例(也与分片有关),此处.
The new mysqlnd driver can perform asynchronous queries. Documentation is sparse, but there are some examples (also relating to sharding) in a presentation here.
这篇关于PHP中的并行MySQL查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文