Re: HELP Tuning SQL statements

From: John Griffin <jgriffin_at_boyne.u-net.com>
Date: 1998/02/14
Message-ID: <34E5E90D.4127B496_at_boyne.u-net.com>#1/1


Are you sure the syntax of your hint is correct?

Generally, the CBO is quite good at picking up hints. However the slightest syntax problem and the hint gets ignored without any error.

Try the following:

SELECT /*+ INDEX(e) */

               *
    FROM employees e
 WHERE e.employee_id = uid;

or even

SELECT /*+ RULE */
              *
    FROM employees e
 WHERE e.employee_id = uid;

huynuye_at_statcan.ca wrote:

> When I use the EXPLAIN PLAN to view the execution plan for my statement.
> The optimizer ignores my index for:
>
> 1) Select * from employees where employee_id = uid;
> uid is a variable from my PL/SQL procedure.
> The Explain show a full table access even when I use Hints.
> However,
>
> 2) Select * from employees where employee_id = '12345';
> will access the table by rowid/ unique index scan on employee_id.
>
> I'm trying to tune an Oracle Web application, and I'm not sure how to use
> bind variable (eg. :uid). Is there a way to use index for my first
> statement.
>
> Thanx
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Sat Feb 14 1998 - 00:00:00 CET

Original text of this message