官术网_书友最值得收藏!

Performance

Another reason to leverage parameters is performance. In a busy SQL Server system, particularly one that has a primarily Online Transaction Processing (OLTP) workload, we may have hundreds or even thousands of queries executing per second.

Assume that each one of these queries took about 100 ms to compile and consumed about the same amount of CPU. This would mean that each second on the system, the server could be consuming hundreds of seconds of CPU time just compiling queries. That's a lot of resources to consume in just preparing the queries for execution, and it doesn't leave a lot of overhead for actually executing them.

Also recall that when plans are not reused, the procedure cache can become very large and consume memory that in turn won't be available for storing data and executing queries. In short, a system that spends too much time compiling queries may become CPU- and/or memory-bound and may perform poorly.

主站蜘蛛池模板: 本溪市| 滕州市| 鹰潭市| 项城市| 阿坝| 梧州市| 油尖旺区| 西峡县| 浪卡子县| 福建省| 玉林市| 宁海县| 双峰县| 中西区| 庆元县| 玉山县| 五华县| 永昌县| 灌阳县| 富宁县| 延庆县| 丰宁| SHOW| 通榆县| 北票市| 莱州市| 晋中市| 瑞丽市| 玉田县| 嘉峪关市| 龙里县| 兖州市| 怀仁县| 十堰市| 兴城市| 弥勒县| 法库县| 镇康县| 万安县| 文安县| 汉中市|