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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Hint Help!

Re: Hint Help!

From: Roberto Bruno <rbruno_at_centroin.com.br>
Date: 1997/05/31
Message-ID: <3390A19F.67C4896C@centroin.com.br>#1/1

Brad Skiles wrote:

> SELECT /*+ INDEX(TRANSACTION TRANSACT_DEPT) */
> AL9.FUND,
> AL9.PROJ,
> AL9.OBJ,
> AL9.AMOUNT,
> AL9.DEPT
> FROM
> TRANSACTION AL9
> WHERE
> AL9.FISC_YR='1996-97' AND
> AL9.DEPT IN ('1330','1333','1335','1336','1337','1338') AND
> AL9.OBJ BETWEEN '52000' AND '52999';
 Your problem here is that the hints recognize tables by alias, not name. your select should be:
SELECT /*+ INDEX(AL9 TRANSACT_DEPT) */

  AL9.FUND,
  AL9.PROJ,
  AL9.OBJ,
  AL9.AMOUNT,
  AL9.DEPT

FROM
  TRANSACTION AL9
WHERE
  AL9.FISC_YR='1996-97' AND
  AL9.DEPT IN ('1330','1333','1335','1336','1337','1338') AND
  AL9.OBJ BETWEEN '52000' AND '52999';

By the way, chances are that it might work all right even without the index name. That colud be better to give the optimizer some maneuvering space. Anyway, just using the alias instead of the table name as I showed above is sure to work.

Roberto Bruno. Received on Sat May 31 1997 - 00:00:00 CDT

Original text of this message

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