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

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP Tuning SQL statements

Re: HELP Tuning SQL statements

From: Young-chul,Jun <ycjun_at_samsung.co.kr>
Date: 1998/02/16
Message-ID: <6c8s32$cb3$1@news.kren.nm.kr>#1/1

huynuye_at_statcan.ca ÀÌ(°¡) <887385518.404684804_at_dejanews.com> ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>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

If you want to use index you should write sql like

Select * from employees where employee_id = ':uid'

Because, employee_id have index.. Received on Mon Feb 16 1998 - 00:00:00 CST

Original text of this message

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