Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: USE_HASH hint

Re: USE_HASH hint

From: Greg Moore <sqlgreg_at_pacbell.net>
Date: Sun, 02 Sep 2001 13:40:20 -0700
Message-ID: <F001.0038079A.20010902135022@fatcity.com>

The problem with the USE_HASH hint is due to the order of the tables in the FROM clause. The hint was:

/*+ ORDERED USE_HASH(c) */

But in the FROM clause the "c" table was listed first. Without the hint I got a Nested Loops, with the hint I got a Sort-Merge.

But when I simply switched the order of the tables in the FROM clause I got the Hash Join.

I am on 8.1.6 on Solaris, and tried several combinations to be sure this problem was related to the requirement that when you have two tables in the from clause, the one you specify in the USE_HASH hint must be listed last.

Guess this behavior makes sense when you think about it.

> Does anyone know why a USE_HASH hint that's properly coded might not work?
> Without it my query uses nested loops, but with it the plan changes to
> sort-merge, not a hash join like I want.
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Greg Moore
> INET: sqlgreg_at_pacbell.net
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Greg Moore
  INET: sqlgreg_at_pacbell.net

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Sun Sep 02 2001 - 15:40:20 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US