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

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.

主站蜘蛛池模板: 隆安县| 平昌县| 邓州市| 钟祥市| 晋中市| 忻城县| 正阳县| 鹤壁市| 炉霍县| 罗定市| 辉县市| 象山县| 扎赉特旗| 深泽县| 永登县| 色达县| 清水县| 英德市| 井陉县| 临西县| 茌平县| 水城县| 孝感市| 都匀市| 合山市| 兰州市| 镇雄县| 玉林市| 正阳县| 辉南县| 衢州市| 巴林左旗| 昌图县| 安阳市| 深泽县| 武安市| 始兴县| 鄂温| 清远市| 湟中县| 临安市|