oracle hints ? use_hash ? ordered ?

lfree發表於2007-04-28

關鍵字: oracle hints use_hash ordered

今天最佳化一個sql語句,想使用hash join看看效果,無論如何使用提示,都無法改變執行計劃。google,首先發現要可以使用LEADING,但是在8i下無效:
發現LEADING的意思是:
LEADING hint causes Oracle to use the specified table as the first table in the join order.An ORDERED hint will override this hint.

改用ordered後,在檢查執行計劃發現可以使用hash join。

ordered:Causes the SQL to be driven by the tables in the order left to right.

我將use_hash括號裡面的表對調,並不能改變執行計劃。

我很少使用hints,為什麼會出現這個問題,自己不知道?


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-83017/,如需轉載,請註明出處,否則將追究法律責任。

相關文章