Originally posted by _John Smith
Can anybody explain me if the following query
with hint USE_HASH will work faster?
If there any precautions?
Thanks in advance.
SELECT /*+ USE_HASH (BILLING_ACCOUNT PRODUCT) */
PRD.PRODUCT_ID = '111'
AND PRD.PRODUCT_TYPE = 'T'
AND PRD.PROD_STATUS = 'A'
AND PRD.EFFECTIVE_DATE - 0 <=
AND BAN.CUSTOMER_ID = PRD.CUSTOMER_ID
AND BAN.BAN = PRD.CUSTOMER_ID
No, nobody can tell you that. If USE_HASH made every query faster, it would be built in and there wouldn't be a hint for it.
The main precaution I would say is: don't add such hints to queries AT ALL unless you have a very good reason for doing so. Don't consider adding hints to queries to be an everyday kind of action: by doing so you hobble the optimizer and prevent it making a free choice to get the best performance.