久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      1. <legend id='K6U2p'><style id='K6U2p'><dir id='K6U2p'><q id='K6U2p'></q></dir></style></legend><tfoot id='K6U2p'></tfoot>
      2. <i id='K6U2p'><tr id='K6U2p'><dt id='K6U2p'><q id='K6U2p'><span id='K6U2p'><b id='K6U2p'><form id='K6U2p'><ins id='K6U2p'></ins><ul id='K6U2p'></ul><sub id='K6U2p'></sub></form><legend id='K6U2p'></legend><bdo id='K6U2p'><pre id='K6U2p'><center id='K6U2p'></center></pre></bdo></b><th id='K6U2p'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='K6U2p'><tfoot id='K6U2p'></tfoot><dl id='K6U2p'><fieldset id='K6U2p'></fieldset></dl></div>
          <bdo id='K6U2p'></bdo><ul id='K6U2p'></ul>

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

        SELECT FOR XML 查詢速度慢嗎?

        Are SELECT FOR XML querys slow?(SELECT FOR XML 查詢速度慢嗎?)
        <tfoot id='1yggS'></tfoot>

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

        <small id='1yggS'></small><noframes id='1yggS'>

            <legend id='1yggS'><style id='1yggS'><dir id='1yggS'><q id='1yggS'></q></dir></style></legend>
              <bdo id='1yggS'></bdo><ul id='1yggS'></ul>
                  <tbody id='1yggS'></tbody>
                  本文介紹了SELECT FOR XML 查詢速度慢嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個存儲過程,它使用 SELECT FOR XML PATH 語句將 XML 返回給調用者.隨著更多行被添加到查詢的主表中,我注意到此查詢的性能有所下降.

                  I have a stored procedure which returns XML to the caller using a SELECT FOR XML PATH statement. As more rows have been added to the main table in the query I have noticed that the performance of this query has degraded.

                  經過調查,我發現在沒有 FOR XML 語句的情況下在 SQL management studio 中運行查詢所需的時間是 FOR XML 查詢所需時間的 1/3.由 FOR XML 調用的 XML 生成是否有很大的開銷,或者在使用 FOR XML 時有哪些應該做和不應該做的事情.

                  On investigation I found that running the query in SQL management studio without the FOR XML statement takes the 1/3 of the time the FOR XML query takes. Is the XML generation that is invoked by FOR XML that much of an overhead or are there some do's and don't s when using FOR XML.

                  下面是我的表定義和使用的返回 > 3000 行的查詢.已更改列名稱以保護無辜者.

                  Below is my table definition and the query used which returns > 3000 rows. The column names have been changed to protect the innocent.

                  歡迎任何建議.

                  CREATE TABLE dbo.results
                  ( 
                  colA  int NOT NULL, 
                  colB  varchar(20) NULL, 
                  colC varchar(30) NULL, 
                  colD varchar(100) NULL, 
                  colE char(3) NULL, 
                  colF int NULL, 
                  colG int NULL, 
                  colH datetime NULL, 
                  colJ int NULL, 
                  colK int NULL, 
                  colL int NULL, 
                  colM int NULL, 
                  colN int NULL, 
                  colO int NULL, 
                  colP int NULL, 
                  colQ int NULL, 
                  colR int NULL, 
                  colS int NULL, 
                  colT int NULL, 
                  colU int NULL, 
                  colV int NULL, 
                  colW int NULL, 
                  colX int NULL, 
                  colY datetime NULL, 
                  colZ int NULL, 
                  colA1 datetime NULL, 
                  colB1 int NULL, 
                  colC1 int NULL, 
                  colD1 int NULL, 
                  colE1 int NULL, 
                  colF1 int NULL, 
                  colG1 int NULL, 
                  colH1 int NULL, 
                  colI1 int NULL, 
                  colK1 int NULL, 
                  colL1 int NULL, 
                  colM1 int NULL, 
                  colN1 int NULL, 
                  colO1 int NULL, 
                  colP1 int NOT NULL, 
                  colQ1 int NOT NULL, 
                  colS1 int NULL, 
                  colT1 int NULL, 
                  colU1 int NULL, 
                  colV1 int NULL, 
                  colW1 int NULL, 
                  colX1 int NULL, 
                  colY1 int NULL, 
                  colZ1 datetime NULL 
                  
                  CONSTRAINT results_pk PRIMARY KEY CLUSTERED 
                  ( 
                     colA ASC 
                  )
                  WITH (PAD_INDEX  = OFF, 
                        STATISTICS_NORECOMPUTE  = OFF, 
                        IGNORE_DUP_KEY = OFF, 
                        ALLOW_ROW_LOCKS  = ON, 
                        ALLOW_PAGE_LOCKS  = ON) 
                   ON PRIMARY) 
                  

                  查詢:

                  select    colA  "@A", 
                            colB "@B", 
                            colC "@C", 
                            colD "@D", 
                            colE "@E", 
                            colF "@F", 
                            colG "@G",                      
                            colH "@H",         
                            colJ "@J", 
                            colK "@K",            
                            colL "@L", 
                            colM "@M", 
                            colO "@O", 
                            colN "@N", 
                            colP "@P", 
                            colQ "@Q", 
                            colR "@R", 
                            colZ1 "@Z1", 
                            colS "@S", 
                            colT "@T", 
                            colU "@U", 
                            colV "@V", 
                            colW "@W", 
                            colX "@X", 
                            colY "@Y", 
                            colP1 "@P1", 
                            colQ1 "@Q1", 
                            colO1 "@O1" 
                  from result
                  order by colO desc , colC 
                  for xml PATH('item'), TYPE 
                  

                  推薦答案

                  只是為了確保您沒有將客戶端渲染時間計入等式,將結果分配給一個變量并查看執行時間是否相同.這是我剛剛在服務器上運行的示例:

                  Just to make sure that you're not taking client rendering time into the equation, assign the result to a variable and see if the execution time is the same. Here's an example I just ran on my server:

                  SET STATISTICS TIME ON
                  go
                  
                  DECLARE @x XML
                  PRINT '------------'
                  SELECT @x =
                  (SELECT * FROM sys.[dm_exec_connections] AS dec
                  FOR XML PATH('connections'), TYPE)
                  PRINT '------------'
                  
                  SELECT * FROM sys.[dm_exec_connections] AS dec
                  FOR XML PATH('connections'), TYPE
                  

                  這是結果(查看執行時間):

                  And here are the results (looking at the execution times):

                  SQL Server parse and compile time: 
                     CPU time = 0 ms, elapsed time = 0 ms.
                  
                   SQL Server Execution Times:
                     CPU time = 0 ms,  elapsed time = 0 ms.
                  SQL Server parse and compile time: 
                     CPU time = 0 ms, elapsed time = 87 ms.
                  ------------
                  
                   SQL Server Execution Times:
                     CPU time = 0 ms,  elapsed time = 34 ms.
                  
                   SQL Server Execution Times:
                     CPU time = 0 ms,  elapsed time = 2 ms.
                  ------------
                  
                   SQL Server Execution Times:
                     CPU time = 0 ms,  elapsed time = 0 ms.
                  
                  (1 row(s) affected)
                  
                   SQL Server Execution Times:
                     CPU time = 15 ms,  elapsed time = 884 ms.
                  

                  將其放入變量需要 34+2=36 毫秒,而將其轉儲到我的屏幕需要 884 毫秒.這是一個很大的不同!

                  Putting it in a variable took 34+2=36 ms whereas dumping it to my screen took 884. That's quite a difference!

                  這篇關于SELECT FOR XML 查詢速度慢嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數據庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發
                  How to create a login to a SQL Server instance?(如何創建對 SQL Server 實例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會出現“數據類型轉換錯誤?使用 ExecuteNonQuery()?)
                  How to show an image from a DataGridView to a PictureBox?(如何將 DataGridView 中的圖像顯示到 PictureBox?)
                  WinForms application design - moving documents from SQL Server to file storage(WinForms 應用程序設計——將文檔從 SQL Server 移動到文件存儲)

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

                      <legend id='nMkn0'><style id='nMkn0'><dir id='nMkn0'><q id='nMkn0'></q></dir></style></legend>

                      <tfoot id='nMkn0'></tfoot>

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

                          <tbody id='nMkn0'></tbody>

                            主站蜘蛛池模板: 国产高清在线 | 蜜桃视频在线观看免费视频网站www | 午夜久久久久 | 亚洲小视频在线播放 | 成人在线精品视频 | 欧美一二三 | 性一爱一乱一交一视频 | 粉嫩av | 欧美电影大全 | 欧美一区二区三区精品 | 亚洲一级淫片 | 久久久久国产 | av一区二区三区四区 | 欧美日韩中文字幕在线 | 91精品国产综合久久香蕉麻豆 | 一级毛片高清 | 爱爱爱av | 国产情侣啪啪 | 综合久久av| 超碰伊人久久 | 亚洲日韩中文字幕一区 | 91资源在线 | 一区二区中文 | 91极品尤物在线播放国产 | av男人的天堂av | av看片| 日韩中文字幕在线免费 | 欧美日日| 中文字幕第十一页 | 91在线观看视频 | 国产一区二区三区免费观看视频 | 亚洲人人舔人人 | av一区二区三区 | 九九久久精品 | 99热在这里只有精品 | 亚洲精品福利在线 | 在线午夜 | 国产成人精品一区二区三区四区 | 精品欧美黑人一区二区三区 | 成人激情视频免费观看 | 久久久久国产精品一区 |