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

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

SQL Performance, Using OPTION (FAST n)(SQL 性能,使用選項(xiàng) (FAST n))
本文介紹了SQL 性能,使用選項(xiàng) (FAST n)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

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

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

比如我這么快就抓取了10萬(wàn)條記錄,但是這對(duì)SQL Server的其他進(jìn)程有影響嗎?

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

我有點(diǎn)接近我的問(wèn)題.

我必須每周運(yùn)行一次數(shù)據(jù)處理.所以第一個(gè)結(jié)果在 5-7 秒后出來(lái),然后我對(duì)這些結(jié)果進(jìn)行數(shù)據(jù)處理.結(jié)果通常由幾千行組成.每一行都需要幾秒鐘的時(shí)間來(lái)處理.通常,該過(guò)程會(huì)等待整個(gè)結(jié)果出現(xiàn),然后開(kāi)始處理.結(jié)果出現(xiàn)在數(shù)據(jù)集中(我正在使用 c# 控制臺(tái)應(yīng)用程序),所以我希望前 10 個(gè)結(jié)果快速出現(xiàn),以便我可以立即開(kāi)始該過(guò)程,然后其余的行出現(xiàn)并添加到隊(duì)列中并等那里轉(zhuǎn).

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 強(qiáng)制查詢(xún)優(yōu)化器不優(yōu)化查詢(xún)的總運(yùn)行時(shí)間,而是優(yōu)化獲取前 N 行所需的時(shí)間.

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 個(gè) 100 萬(wàn)行的表要加入,標(biāo)準(zhǔn)查詢(xún)計(jì)劃是一個(gè)表(一百萬(wàn)行的臨時(shí)表)的哈希圖,然后在另一個(gè)表上使用哈希圖查找.

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 優(yōu)化可能只使用嵌套循環(huán),因?yàn)闃?gòu)建 100 萬(wàn)行哈希圖的工作量比嵌套循環(huán)的快速 10 步驟要多得多.如果您畢竟有 100 萬(wàn)行,則嵌套循環(huán)可能需要多花 3 倍的時(shí)間,但在快速 10 行下,您會(huì)更快地獲得這 10 行.(這個(gè)例子假設(shè)存在一個(gè)合適的索引)

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)

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

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

相關(guān)文檔推薦

SQL - Select all when filter value is empty(SQL - 過(guò)濾器值為空時(shí)全選)
How and where do I set the MAXRECURSION option?(如何以及在何處設(shè)置 MAXRECURSION 選項(xiàng)?)
TABLOCKX versus SERIALIZABLE(TABLOCKX 與可序列化)
TSQL Constants... Use Variable or Literal?(TSQL 常量...使用變量還是文字?)
TSQL RIGHT String function not working(TSQL RIGHT 字符串函數(shù)不起作用)
What is the comparative speed of temporary tables to physical tables in SQL?(SQL中臨時(shí)表與物理表的比較速度是多少?)
主站蜘蛛池模板: 丁香五月网久久综合 | 1区2区3区视频 | 亚洲精品欧美 | 国产精品久久久久久久久久三级 | 国产一区欧美一区 | 精品日韩一区 | 欧洲一区二区三区 | 精品综合 | 在线免费看91 | 羞羞的视频免费在线观看 | 免费久久网 | 亚洲成人一区二区三区 | 日韩视频国产 | 国产欧美一区二区三区在线看 | 国产视频福利在线观看 | 国产一区三区在线 | 日韩精品视频网 | 亚洲永久 | 国产精品中文在线 | 黄色播放 | 日韩欧美在线一区 | 在线中文字幕视频 | 国产在线观看一区二区三区 | 国产美女在线免费观看 | 欧美乱淫视频 | 成人在线亚洲 | 91精品久久久久久久久99蜜臂 | 毛片黄| 亚洲国产第一页 | 一区在线观看 | 国产激情毛片 | 一级片网址 | 久久新| 日韩av成人 | www精品美女久久久tv | 国产精品不卡视频 | 中文字幕在线第二页 | 久久成人综合 | 欧美一级特黄aaa大片在线观看 | 人人玩人人添人人澡欧美 | 国产乱一区二区三区视频 |