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

SQLServer:為什么要避免使用表值用戶定義函數(shù)?

SQLServer: Why avoid Table-Valued User Defined Functions?(SQLServer:為什么要避免使用表值用戶定義函數(shù)?)
本文介紹了SQLServer:為什么要避免使用表值用戶定義函數(shù)?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

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

我有一個(gè)相當(dāng)大的查詢,需要在幾個(gè)存儲(chǔ)過程中使用,我想將其轉(zhuǎn)換為 UDF 以使其更易于維護(hù)(視圖不起作用,這需要一堆參數(shù)),但是我曾經(jīng)與之交談過的每個(gè)人都告訴我 UDF 的速度非常慢.

I have a rather huge query that is needed in several stored procedures, and I'd like to shift it into a UDF to make it easier to maintain (A view won't work, this takes in a bunch of parameters), however everyone I've ever talked to has told me that UDF's are incredibly slow.

雖然我不知道究竟是什么讓它們變慢,但我會(huì)猜測(cè)它們是,但看到我沒有在連接中使用這個(gè) UDF,而是返回一個(gè)表變量,我認(rèn)為它不會(huì)那么糟糕.

While I don't know what exactly makes them slow, I'm will to guess that they are, but seeing as I'm not using this UDF within a join, but instead to return a table variable, I think it wouldn't be that bad.

所以我想問題是,我應(yīng)該不惜一切代價(jià)避免使用 UDF 嗎?任何人都可以指出具體的證據(jù)表明它們更慢嗎?

So I guess the question is, should I avoid UDFs at all cost? Can anyone point to concrete evidence stating that they are slower?

推薦答案

標(biāo)量 UDF 非常慢,內(nèi)聯(lián) UDF 實(shí)際上是宏,因此它們非常快:幾篇文章:

Scalar UDFs are very slow, inline UDFs are in fact macros, as such they are very fast: A few articles:

使用表值 UDF 重用您的代碼

許多嵌套的內(nèi)聯(lián) UDF 非常快

有關(guān)標(biāo)量 UDF 緩慢的更多鏈接:

More links on slowness of scalar UDFs:

帶有日期時(shí)間的 UDF 的 SQL Server 性能模式參數(shù)

并非所有 UDF 都對(duì)性能不利

這篇關(guān)于SQLServer:為什么要避免使用表值用戶定義函數(shù)?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

What SQL Server Datatype Should I Use To Store A Byte[](我應(yīng)該使用什么 SQL Server 數(shù)據(jù)類型來存儲(chǔ)字節(jié) [])
Interpreting type codes in sys.objects in SQL Server(解釋 SQL Server 中 sys.objects 中的類型代碼)
Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否應(yīng)該返回“1?什么時(shí)候不能投射為日期?)
Converting the name of a day to its integer representation(將一天的名稱轉(zhuǎn)換為其整數(shù)表示)
How to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中將 nvarchar m/d/yy 轉(zhuǎn)換為 mm/dd/yyyy?)
主站蜘蛛池模板: 日韩精品二区 | 黄色av网站免费看 | 97精品超碰一区二区三区 | 一级黄色网页 | 亚洲成人av在线播放 | 欧美日韩一 | 国产高清在线观看 | 国产精品久久免费观看 | 自拍偷拍第一页 | 日韩精品成人av | 少妇精品久久久久久久久久 | 精品久久久久香蕉网 | 99久久精品国产一区二区三区 | 日韩精品视频网 | 国产在线视频一区二区董小宛性色 | 国产精品伦一区二区三级视频 | 亚洲精品日韩在线观看 | 黄色片视频 | 日韩在线不卡 | 在线观看黄色大片 | 色资源站| 亚洲巨乳自拍在线视频 | 亚洲人在线播放 | 久久三级av | 国产中文| 2018天天干天天操 | 草草草网站 | 免费一级片 | 久久中文免费视频 | 国产成人艳妇aa视频在线 | 蜜臀久久| 国产精品夜夜春夜夜爽久久电影 | 国产精品视频观看 | 91在线网站 | avhd101在线成人播放 | 欧美日韩午夜精品 | 在线免费观看日本视频 | 久久综合伊人 | 欧美一级网站 | 日日操av| 99av成人精品国语自产拍 |