MySQL数据库中如何同时处理查询? [英] How simultaneous queries are handled in a MySQL database?

查看:70
本文介绍了MySQL数据库中如何同时处理查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MySQL数据库,我想知道是否同时进行多个(500个或更多)查询以便从多个表中获取信息,这些查询如何处理?顺序还是并行?

I am using MySQL database and I would like to know if I make multiple (500 and more) queries simultaneously in order to get information from multiple tables, how these queries are handled? Sequentially or in parallel?

推荐答案

查询总是在多个会话(即客户端连接)之间并行处理.单个连接上的所有查询都一个接一个地运行.可以根据您可用的服务器资源来配置多个连接之间的并行度.

Queries are always handled in parallel between multiple sessions (i.e. client connections). All queries on a single connections are run one-after-another. The level of parallelism between multiple connections can be configured depending on your available server resources.

通常,某些操作在单独的查询会话之间被保护(称为事务).这些由InnoDB后端支持,但MyISAM表不受支持(但它支持称为原子操作的概念).隔离的程度各不相同,这些不同之处在于相互保护的操作(以及一个并行事务中的操作如何影响另一个)以及它们对性能的影响.

Generally, some operations are guarded between individual query sessions (called transactions). These are supported by InnoDB backends, but not MyISAM tables (but it supports a concept called atomic operations). There are various level of isolation which differ in which operations are guarded from each other (and thus how operations in one parallel transactions affect another) and in their performance impact.

有关更多信息,请参见常规中的交易以及

For more information read about transactions in general and the implementation in MySQL.

这篇关于MySQL数据库中如何同时处理查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆