Home > Database > Mysql Tutorial > 内嵌或嵌入SQL和存储过程之对比_MySQL

内嵌或嵌入SQL和存储过程之对比_MySQL

WBOY
Release: 2016-06-01 14:05:33
Original
1074 people have browsed it

问:为什么我的内嵌SQL或嵌入SQL 要比我的存储过程运行的快?

答:重编译可能是存储过程运行比较慢的原因。要确认这一点,您需要做一些性能测试,例如:看一下每种类型的查询和调用存储过程的“showplan”情况,并比较查询计划的高速缓存命中率和高速缓存缺失率。您还可以试着在存储过程内部为引用表、视图和过程写出对象拥有者。如下面例子所示:

SELECT * FROM dbo.mytable

这样有助于您重新使用计划并防止高速缓存缺失。

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