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: SQL fast, PL/SQL slow, optimizer confused.

Re: SQL fast, PL/SQL slow, optimizer confused.

From: srivenu <srivenu_at_hotmail.com>
Date: 27 Feb 2004 04:48:21 -0800
Message-ID: <1a68177.0402270448.69e2ee7f@posting.google.com>


Set the init.ora parameter _like_with_bind_as_equality=TRUE. Even Oracle APPS recommends it.
This will cause the optimizer to favour the Index scan for LIKE predicates.
Normally LIKE predicates with binds (since it is PL/SQL) will have a selectivity of 5%. So the optimizer may go in for FTS depending on other factors.
If you set _like_with_bind_as_equality=TRUE then the optimizer will evaluate the selectivity of the LIKE predicate the same as a EQUALITY predicate.
(The selectivity of the clause c1 = :bind1 (Num of Rows - Num of Nulls in column c1) / (Number of Distinct Values).)

regards
Srivenu Received on Fri Feb 27 2004 - 06:48:21 CST

Original text of this message

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