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

SQL 性能,使用選項 (FAST n)

SQL Performance, Using OPTION (FAST n)(SQL 性能,使用選項 (FAST n))
本文介紹了SQL 性能,使用選項 (FAST n)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

誰能告訴我在 SQL 查詢中使用 OPTION (FAST n) 的缺點是什么.

Can anyone tell me what's the disadvantages of using OPTION (FAST n) in SQL Queries.

比如我這么快就抓取了10萬條記錄,但是這對SQL Server的其他進程有影響嗎?

For example, I grab 100,000 records so quickly, but does this make effect on other processes of SQL Server?

我有點接近我的問題.

我必須每周運行一次數據處理.所以第一個結果在 5-7 秒后出來,然后我對這些結果進行數據處理.結果通常由幾千行組成.每一行都需要幾秒鐘的時間來處理.通常,該過程會等待整個結果出現,然后開始處理.結果出現在數據集中(我正在使用 c# 控制臺應用程序),所以我希望前 10 個結果快速出現,以便我可以立即開始該過程,然后其余的行出現并添加到隊列中并等那里轉.

I have to run a data process every week. So the first result comes out after 5-7 seconds and then I do my data process on these results. The results normally consists of few thousand rows. and every row take a few seconds to be processed. Normally the process waits for the whole result to be there then it start processing. The result comes out in dataset (I am using c# console app), I So I want the top 10 results to comes out quickly so that I can start the process immediately and then the rest of the rows comes out and add in the queue and wait for there turn.

知道我該怎么做.

謝謝

推薦答案

Option fast 強制查詢優化器不優化查詢的總運行時間,而是優化獲取前 N 行所需的時間.

Option fast forces the query optimizer to not optimize the total runtime of the query, but the time it takes to fetch the first N rows.

如果您有 2 個 100 萬行的表要加入,標準查詢計劃是一個表(一百萬行的臨時表)的哈希圖,然后在另一個表上使用哈希圖查找.

if you have 2 tables of 1 million rows you want to join, a standard query plan is a hashmap of one table (temp table of a million rows) and then use a hashmap lookup on the other.

快速 10 優化可能只使用嵌套循環,因為構建 100 萬行哈希圖的工作量比嵌套循環的快速 10 步驟要多得多.如果您畢竟有 100 萬行,則嵌套循環可能需要多花 3 倍的時間,但在快速 10 行下,您會更快地獲得這 10 行.(這個例子假設存在一個合適的索引)

a fast 10 optimisation would probably just use nested loops, because the effort of building that 1 million row hashmap is quite a bit more than the fast 10 steps of nested loop. If you are after all 1 million rows, the nested loop could take 3 times longer, but under fast 10, you'll get those 10 quicker. (this example assumes the existence of a suitable index)

這篇關于SQL 性能,使用選項 (FAST n)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

SQL - Select all when filter value is empty(SQL - 過濾器值為空時全選)
How and where do I set the MAXRECURSION option?(如何以及在何處設置 MAXRECURSION 選項?)
TABLOCKX versus SERIALIZABLE(TABLOCKX 與可序列化)
TSQL Constants... Use Variable or Literal?(TSQL 常量...使用變量還是文字?)
TSQL RIGHT String function not working(TSQL RIGHT 字符串函數不起作用)
What is the comparative speed of temporary tables to physical tables in SQL?(SQL中臨時表與物理表的比較速度是多少?)
主站蜘蛛池模板: 国产精品一区在线 | 欧美中文字幕一区二区三区亚洲 | 在线午夜 | 国产精品99久久久久久www | 国产一区亚洲二区三区 | 成年人精品视频在线观看 | 日韩福利 | 国产亚洲欧美在线视频 | 精品一级电影 | 欧美性生活一区二区三区 | 国产精品久久久久久久久久久免费看 | 丁香综合| 欧美一二三四成人免费视频 | 97人澡人人添人人爽欧美 | 亚洲国产精品久久久 | 黄色免费看 | 干干干操操操 | 国产ts一区| 国产视频精品在线观看 | 欧美亚洲国产日韩 | 欧美日韩国产一区二区三区不卡 | 欧州一区二区三区 | 久久国内精品 | 国产精品一区二区三 | 亚洲成人一二区 | 精品国产乱码久久久久久中文 | 韩日av在线 | 国产ts人妖系列高潮 | 亚洲传媒在线 | 日韩国产中文字幕 | 成人精品鲁一区一区二区 | 国产在线精品一区二区 | 老外黄色一级片 | 日韩中文字幕 | yiren22综合网成人 | 欧美中文在线 | 在线观看免费av网 | 久久久精 | 久草免费福利 | 亚洲电影一级片 | 91视频导航 |