pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

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

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  我有一個(gè)存儲(chǔ)過程,它使用 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 中運(yùn)行查詢所需的時(shí)間是 FOR XML 查詢所需時(shí)間的 1/3.由 FOR XML 調(diào)用的 XML 生成是否有很大的開銷,或者在使用 FOR XML 時(shí)有哪些應(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 
                  

                  推薦答案

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

                  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í)行時(shí)間):

                  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)儲(chǔ)到我的屏幕需要 884 毫秒.這是一個(gè)很大的不同!

                  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 查詢速度慢嗎?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 實(shí)例使用的空間嗎?) - IT屋-程序員軟件開發(fā)
                  How to create a login to a SQL Server instance?(如何創(chuàng)建對(duì) SQL Server 實(shí)例的登錄?)
                  How to know the version and edition of SQL Server through registry search(如何通過注冊(cè)表搜索知道SQL Server的版本和版本)
                  Why do I get a quot;data type conversion errorquot; with ExecuteNonQuery()?(為什么會(huì)出現(xiàn)“數(shù)據(jù)類型轉(zhuǎn)換錯(cuò)誤?使用 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è)計(jì)——將文檔從 SQL Server 移動(dòng)到文件存儲(chǔ))

                  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="0ucomsq" 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>

                            主站蜘蛛池模板: 安全光栅|射频导纳物位开关|音叉料位计|雷达液位计|两级跑偏开关|双向拉绳开关-山东卓信机械有限公司 | 长城人品牌官网| 传动滚筒,改向滚筒-淄博建凯机械科技有限公司 | 美侍宠物-专注宠物狗及宠物猫训练|喂养|医疗|繁育|品种|价格 | 口臭的治疗方法,口臭怎么办,怎么除口臭,口臭的原因-口臭治疗网 | 卸料器-卸灰阀-卸料阀-瑞安市天蓝环保设备有限公司 | 安徽控制器-合肥船用空调控制器-合肥家电控制器-合肥迅驰电子厂 安徽净化板_合肥岩棉板厂家_玻镁板厂家_安徽科艺美洁净科技有限公司 | 气力输送_输送机械_自动化配料系统_负压吸送_制造主力军江苏高达智能装备有限公司! | 熔体泵_熔体出料泵_高温熔体泵-郑州海科熔体泵有限公司 | 玉米加工设备,玉米深加工机械,玉米糁加工设备.玉米脱皮制糁机 华豫万通粮机 | 煤矿人员精确定位系统_矿用无线通信系统_煤矿广播系统 | 厂房出租-厂房规划-食品技术-厂房设计-厂房装修-建筑施工-设备供应-设备求购-龙爪豆食品行业平台 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛婚外情取证-青岛王军侦探事务所 | 石栏杆_青石栏杆_汉白玉栏杆_花岗岩栏杆 - 【石雕之乡】点石石雕石材厂 | 临海涌泉蜜桔官网|涌泉蜜桔微商批发代理|涌泉蜜桔供应链|涌泉蜜桔一件代发 | 电动不锈钢套筒阀-球面偏置气动钟阀-三通换向阀止回阀-永嘉鸿宇阀门有限公司 | 企业VI设计_LOGO设计公司_品牌商标设计_【北京美研】 | 噪声治理公司-噪音治理专业隔音降噪公司 | 找果网 | 苹果手机找回方法,苹果iPhone手机丢了找回,认准找果网! | 无菌实验室规划装修设计-一体化实验室承包-北京洁净净化工程建设施工-北京航天科恩实验室装备工程技术有限公司 | 右手官网|右手工业设计|外观设计公司|工业设计公司|产品创新设计|医疗产品结构设计|EMC产品结构设计 | 无刷电机_直流无刷电机_行星减速机-佛山市藤尺机电设备有限公司 无菌检查集菌仪,微生物限度仪器-苏州长留仪器百科 | 政府回应:200块在义乌小巷能买到爱情吗?——揭秘打工族省钱约会的生存智慧 | PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 铆钉机|旋铆机|东莞旋铆机厂家|鸿佰专业生产气压/油压/自动铆钉机 | 培训无忧网-教育培训咨询招生第三方平台| 热镀锌槽钢|角钢|工字钢|圆钢|H型钢|扁钢|花纹板-天津千百顺钢铁贸易有限公司 | 上海阳光泵业制造有限公司 -【官方网站】 | 钢绞线万能材料试验机-全自动恒应力两用机-混凝土恒应力压力试验机-北京科达京威科技发展有限公司 | 东莞市海宝机械有限公司-不锈钢分选机-硅胶橡胶-生活垃圾-涡电流-静电-金属-矿石分选机 | 地埋式垃圾站厂家【佳星环保】小区压缩垃圾中转站转运站 | 比士亚-专业恒温恒湿酒窖,酒柜,雪茄柜的设计定制 | 中红外QCL激光器-其他连续-半导体连续激光器-筱晓光子 | 动力配电箱-不锈钢配电箱-高压开关柜-重庆宇轩机电设备有限公司 聚天冬氨酸,亚氨基二琥珀酸四钠,PASP,IDS - 远联化工 | 钢衬四氟管道_钢衬四氟直管_聚四氟乙烯衬里管件_聚四氟乙烯衬里管道-沧州汇霖管道科技有限公司 | EPDM密封胶条-EPDM密封垫片-EPDM生产厂家 | 彩超机-黑白B超机-便携兽用B超机-多普勒彩超机价格「大为彩超」厂家 | 衡阳耐适防护科技有限公司——威仕盾焊接防护用品官网/焊工手套/焊接防护服/皮革防护手套 | 贵阳用友软件,贵州财务软件,贵阳ERP软件_贵州优智信息技术有限公司 | 热处理炉-退火炉-回火炉设备厂家-丹阳市电炉厂有限公司 | 时代北利离心机,实验室离心机,医用离心机,低速离心机DT5-2,美国SKC采样泵-上海京工实业有限公司 工业电炉,台车式电炉_厂家-淄博申华工业电炉有限公司 |