Account Options

  1. Sign in
Google Groups Home
« Groups Home
CBO & different execution plans
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 30 of 30 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
DA Morgan  
View profile  
 More options Mar 12 2007, 6:16 pm
Newsgroups: comp.databases.oracle.server
From: DA Morgan <damor...@psoug.org>
Date: Mon, 12 Mar 2007 15:16:51 -0700
Local: Mon, Mar 12 2007 6:16 pm
Subject: Re: CBO & different execution plans

I agree. Maybe you could fool the CBO by making some inconsequential
change so that it would see the statement as different. For example:

For example:
WHERE C2+0 = x+0;

Though, of course, that can cause unintended collateral damage.
--
Daniel A. Morgan
University of Washington
damor...@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


 
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.
DA Morgan  
View profile  
 More options Mar 12 2007, 6:18 pm
Newsgroups: comp.databases.oracle.server
From: DA Morgan <damor...@psoug.org>
Date: Mon, 12 Mar 2007 15:18:43 -0700
Local: Mon, Mar 12 2007 6:18 pm
Subject: Re: CBO & different execution plans

My experience with character sets was that I originally selected
a character set that supported multibyte characters and had to
change to WE8MSWIN1252 to get it to work.

The page: http://www.psoug.org/reference/character_sets.html
is the result of that incident.
--
Daniel A. Morgan
University of Washington
damor...@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


 
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.
Charles Hooper  
View profile  
 More options Mar 12 2007, 6:44 pm
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:

It looks like you might have a good work around, as long as the extra
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
  *
FROM
  T1
WHERE
  C2=5;

SELECT
  *
FROM
  TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS'));

SQL_ID  7q30ztw0h1w4t, child number 1
-------------------------------------
SELECT   * FROM   T1 WHERE   C2=5

Plan hash value: 3332582666

--------------------------------------------------------------------------- ----------
| Id  | Operation          | Name | Starts | E-Rows | A-Rows |   A-
Time   | Buffers |
--------------------------------------------------------------------------- ----------
|*  1 |  FILTER            |      |      1 |        |    200 |
00:00:00.01 | 37 |
|*  2 |   TABLE ACCESS FULL| T1   |      1 |    200 |    200 |
00:00:00.01 | 37 |
--------------------------------------------------------------------------- -----

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - filter(SYSDATE@!=SYSDATE@!)
   2 - filter("C2"=5)

And now to put the system back to normal:
EXEC SYS.DBMS_ADVANCED_REWRITE.DROP_REWRITE_EQUIVALENCE('T1_EQ2');

SQL_ID  7q30ztw0h1w4t, child number 0
-------------------------------------
SELECT   * FROM   T1 WHERE   C2=5

Plan hash value: 3586113557

--------------------------------------------------------------------------- -----------
| Id  | Operation        | Name    | Starts | E-Rows | A-Rows |   A-
Time   | Buffers |
--------------------------------------------------------------------------- -----------
|*  1 |  INDEX RANGE SCAN| IND_JT2 |      1 |    200 |    200 |
00:00:00.01 |  16 |
--------------------------------------------------------------------------- -----------

Predicate Information (identified by operation id):
---------------------------------------------------
   1 - access("C2"=5)

Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.


 
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.
Matthias Hoys  
View profile  
 More options Apr 7 2007, 10:33 am
Newsgroups: comp.databases.oracle.server
From: "Matthias Hoys" <a...@spam.com>
Date: Sat, 7 Apr 2007 16:33:29 +0200
Local: Sat, Apr 7 2007 10:33 am
Subject: Re: CBO & different execution plans

"Matthias Hoys" <a...@spam.com> wrote in message

news:45ef1abf$0$2940$ba620e4c@news.skynet.be...

By accident, I found the solution for this problem on MetaLink :

Bug 4652274 - Explain Plan Differs With Different Users

It has to do with the init parameter secure_view_merging, which is new since
10gR2. Setting it to FALSE in the spfile and boucing the instance resolved
all my problems ... Now queries on view from another schema have the same
exection plans when executed by the view owner compared to another user.

Matthias


 
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.
Jonathan Lewis  
View profile  
 More options Apr 8 2007, 10:43 am
Newsgroups: comp.databases.oracle.server
From: "Jonathan Lewis" <jonat...@jlcomp.demon.co.uk>
Date: Sun, 8 Apr 2007 15:43:35 +0100
Local: Sun, Apr 8 2007 10:43 am
Subject: Re: CBO & different execution plans

"Matthias Hoys" <a...@spam.com> wrote in message

news:4617abb4$0$13866$ba620e4c@news.skynet.be...

Thanks for the feedback.

--
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


 
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.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »