指數ROW_NUMBER表現我對形式的查詢:提高超過分區查詢
select a, b, c, d, e, f, g, h,
row_number() over (partition by a, b order by c, d, e, f) as order
from table;
而且它的性能是一種可怕的。
我們已經嘗試創建2個索引,第一個按列(a和b)分區,第二個按列(c,d,e,f)排序。
使用解釋計劃,我們發現索引沒有被使用。儘管它們用於其他具有group by子句的查詢。
關於如何重構查詢或重新創建索引的任何想法,以便它們幫助查詢性能?
在此先感謝
請發佈查詢計劃。 – 2012-03-06 03:58:38
列是否不爲空? – 2012-03-06 05:58:15