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

  • Learn T-SQL Querying
  • Pedro Lopes Pam Lahoud
  • 157字
  • 2021-06-24 14:38:15

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.

主站蜘蛛池模板: 永平县| 鄂托克前旗| 盐城市| 琼海市| 石河子市| 玛多县| 胶州市| 鸡西市| 邯郸县| 封开县| 连江县| 包头市| 芷江| 西安市| 驻马店市| 莲花县| 顺义区| 西峡县| 吴桥县| 随州市| 应用必备| 琼中| 怀远县| 平果县| 哈巴河县| 葫芦岛市| 宁阳县| 苍梧县| 虞城县| 岱山县| 阳谷县| 雷山县| 观塘区| 克什克腾旗| 寿宁县| 楚雄市| 芜湖县| 肇州县| 沭阳县| 大渡口区| 华宁县|