久久久久久久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 查詢速度慢嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

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

                  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.

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

                  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 行的查詢.已更改列名稱以保護(hù)無辜者.

                  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 
                  

                  推薦答案

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

                  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
                  

                  這是結(jié)果(查看執(zhí)行時間):

                  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 毫秒,而將其轉(zhuǎn)儲到我的屏幕需要 884 毫秒.這是一個很大的不同!

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

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

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

                  相關(guān)文檔推薦

                  Can I figure out a list of databases and the space used by SQL Server instances without writing SQL queries?(我可以在不編寫 SQL 查詢的情況下找出數(shù)據(jù)庫列表和 SQL Server 實例使用的空間嗎?) - IT屋-程序員軟件開發(fā)
                  How to create a login to a SQL Server instance?(如何創(chuàng)建對 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()?(為什么會出現(xiàn)“數(shù)據(jù)類型轉(zhuǎn)換錯誤?使用 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 應(yīng)用程序設(shè)計——將文檔從 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>

                            主站蜘蛛池模板: chinese中国真实乱对白 | 亚洲欧美中文日韩在线v日本 | 欧美日韩一区在线 | 中文字幕欧美一区 | 欧美黄色片| 中文字幕综合 | 日韩国产中文字幕 | 伊人狠狠操 | 欧美精品影院 | 日本成人在线免费视频 | 美女毛片免费看 | 亚洲另类自拍 | 欧美日韩国产一区二区 | 午夜精品一区二区三区在线 | 色精品视频 | 亚洲激情在线观看 | 欧美精品国产精品 | 麻豆精品国产91久久久久久 | 男人天堂av网| 亚洲成人一区 | 日韩高清中文字幕 | 国产精品免费大片 | 亚洲国产精品一区二区久久 | 伊人网站在线 | 免费高清成人 | 欧美色综合一区二区三区 | 日韩精品一区二区三区四区 | 国户精品久久久久久久久久久不卡 | 久久久青草 | 在线观看深夜视频 | 四虎永久免费黄色影片 | 亚洲人在线播放 | 国产精品久久久久久久久久妇女 | 中文字幕 在线观看 | 91视频大全 | 在线亚洲欧美 | 午夜精品久久久久久久星辰影院 | 黄网免费看 | 国产成人99av超碰超爽 | 欧美日韩国产精品激情在线播放 | 中文字幕一区二区三区在线视频 |