Newsgroups: comp.databases.oracle.server
From: "Charles Hooper" <hooperc2...@yahoo.com>
Date: 12 Mar 2007 15:44:03 -0700
Local: Mon, Mar 12 2007 6:44 pm
Subject: Re: CBO & different execution plans
On Mar 12, 6:16 pm, DA Morgan <damor...@psoug.org> wrote:
> Charles Hooper wrote: It looks like you might have a good work around, as long as the extra > > * > > ERROR at line 1: > > ORA-30394: source statement identical to the destination statement > > ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29 > > ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185 > > ORA-06512: at line 2 > > It would be nice to use DBMS_ADVANCED_REWRITE to add a hint, such as > > And leave the rest of the SQL statement alone. > > Charles Hooper > I agree. Maybe you could fool the CBO by making some inconsequential > For example: > Though, of course, that can cause unintended collateral damage. predicate does not significantly affect the cost. Here is an example: BEGIN SYS.DBMS_ADVANCED_REWRITE.DECLARE_REWRITE_EQUIVALENCE ( NAME => 'T1_EQ2', SOURCE_STMT => 'SELECT * FROM T1 WHERE C2=5', DESTINATION_STMT => 'SELECT /*+ FULL(T1) */ * FROM T1 WHERE C2=5 AND SYSDATE=SYSDATE', VALIDATE => FALSE, REWRITE_MODE => 'TEXT_MATCH' ); END; / SELECT SELECT SQL_ID 7q30ztw0h1w4t, child number 1 Plan hash value: 3332582666 --------------------------------------------------------------------------- ---------- Predicate Information (identified by operation id): And now to put the system back to normal: SQL_ID 7q30ztw0h1w4t, child number 0 Plan hash value: 3586113557 --------------------------------------------------------------------------- ----------- Predicate Information (identified by operation id): Charles Hooper You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||