• <tfoot id='drfXA'></tfoot>

    <small id='drfXA'></small><noframes id='drfXA'>

        <i id='drfXA'><tr id='drfXA'><dt id='drfXA'><q id='drfXA'><span id='drfXA'><b id='drfXA'><form id='drfXA'><ins id='drfXA'></ins><ul id='drfXA'></ul><sub id='drfXA'></sub></form><legend id='drfXA'></legend><bdo id='drfXA'><pre id='drfXA'><center id='drfXA'></center></pre></bdo></b><th id='drfXA'></th></span></q></dt></tr></i><div id='drfXA'><tfoot id='drfXA'></tfoot><dl id='drfXA'><fieldset id='drfXA'></fieldset></dl></div>

      1. <legend id='drfXA'><style id='drfXA'><dir id='drfXA'><q id='drfXA'></q></dir></style></legend>
          <bdo id='drfXA'></bdo><ul id='drfXA'></ul>
      2. LINQ 和存储过程之间的性能差异

        时间:2023-10-25
        <i id='pGBug'><tr id='pGBug'><dt id='pGBug'><q id='pGBug'><span id='pGBug'><b id='pGBug'><form id='pGBug'><ins id='pGBug'></ins><ul id='pGBug'></ul><sub id='pGBug'></sub></form><legend id='pGBug'></legend><bdo id='pGBug'><pre id='pGBug'><center id='pGBug'></center></pre></bdo></b><th id='pGBug'></th></span></q></dt></tr></i><div id='pGBug'><tfoot id='pGBug'></tfoot><dl id='pGBug'><fieldset id='pGBug'></fieldset></dl></div>
        <tfoot id='pGBug'></tfoot>

          <tbody id='pGBug'></tbody>
      3. <small id='pGBug'></small><noframes id='pGBug'>

          <bdo id='pGBug'></bdo><ul id='pGBug'></ul>
          • <legend id='pGBug'><style id='pGBug'><dir id='pGBug'><q id='pGBug'></q></dir></style></legend>

                1. 本文介绍了LINQ 和存储过程之间的性能差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  LINQ-to-SQL 与存储过程?

                  我听说过很多关于预编译存储过程的优点的讨论.但是 LINQ 和存储过程在选择、插入、更新、删除上的实际性能差异是什么?有没有人进行任何测试以查看是否有任何重大差异.我也很好奇更多的交易是否会产生影响.

                  I have heard a lot of talk back and forth about the advantages of stored procedures being pre compiled. But what are the actual performance difference between LINQ and Stored procedures on Selects, Inserts, Updates, Deletes? Has anyone run any tests at all to see if there is any major difference. I'm also curious if a greater number of transactions makes a difference.

                  我的猜测是 LINQ 语句在第一个事务之后被缓存,性能可能几乎相同.想法?

                  My guess is that LINQ statements get cached after the first transaction and performance is probably going to be nearly identical. Thoughts?

                  推荐答案

                  LINQ 应该在性能上接近,但我不同意上面说 LINQ 更快的说法,它不可能更快,它可能就像不过很快,其他条件都一样.

                  LINQ should be close in performance but I disagree with the statement above that says LINQ is faster, it can't be faster, it could possibly be just as as fast though, all other things being equal.

                  我认为不同之处在于,知道如何优化并使用存储过程的优秀 SQL 开发人员在性能上总是略有优势.如果你不擅长 SQL,让 Linq 为你解决,你的表现很可能会被接受.如果您是一名强大的 SQL 开发人员,如果您的应用需要,可以使用存储过程来挤出一点额外的性能.

                  I think the difference is that a good SQL developer, who knows how to optimize, and uses stored procedures is always going to have a slight edge in performance. If you are not strong on SQL, let Linq figure it out for you, and your performance is most likely going to be acceptable. If you are a strong SQL developer, use stored procedures to squeeze out a bit of extra performance if you app requires it.

                  如果您编写糟糕的 SQL 来编写一些执行速度比 Linq 慢的存储过程,这当然是可能的,但是如果您知道自己在做什么,那么存储过程和 Datareader 就无敌了.

                  It certainly is possible if you write terrible SQL to code up some stored procedures that execute slower than Linq would, but if you know what you are doing, stored procedures and a Datareader can't be beat.

                  这篇关于LINQ 和存储过程之间的性能差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何获取存储过程参数的详细信息? 下一篇:mysql 存储过程:输出参数

                  相关文章

                  <tfoot id='FXyLL'></tfoot>

                  1. <i id='FXyLL'><tr id='FXyLL'><dt id='FXyLL'><q id='FXyLL'><span id='FXyLL'><b id='FXyLL'><form id='FXyLL'><ins id='FXyLL'></ins><ul id='FXyLL'></ul><sub id='FXyLL'></sub></form><legend id='FXyLL'></legend><bdo id='FXyLL'><pre id='FXyLL'><center id='FXyLL'></center></pre></bdo></b><th id='FXyLL'></th></span></q></dt></tr></i><div id='FXyLL'><tfoot id='FXyLL'></tfoot><dl id='FXyLL'><fieldset id='FXyLL'></fieldset></dl></div>

                      <legend id='FXyLL'><style id='FXyLL'><dir id='FXyLL'><q id='FXyLL'></q></dir></style></legend>
                        <bdo id='FXyLL'></bdo><ul id='FXyLL'></ul>

                      <small id='FXyLL'></small><noframes id='FXyLL'>