Home > Database > Mysql Tutorial > body text

sql性能优化-mysql子查询是否被重复执行?

WBOY
Release: 2016-06-06 09:44:51
Original
1707 people have browsed it

mysqlsql性能优化

请教!mysql返回固定结果集时,是否被重复执行
例如1:select t.*,(select count(1) from table01) from table01 t;

例如2:select t.*,(select count(1) from table01 t2 where t2.key=t1.key) from table01 t1 ;——像这种嵌套的子查询是会被重复执行的。
疑问:上面例子1中的子查询遍历过程中,都是固定结果集,会被重复执行N遍吗(N条记录)?
执行计划中是如何查看子查询有无重复执行,或分析子查询的执行效率,求教!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template