Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from puck1183.startdedicated.com (localhost [127.0.0.1])
 by puck1183.startdedicated.com (Postfix) with ESMTP id C161D19605D3
 for <oracle-l@orafaq.com>; Thu,  6 Jun 2013 08:36:08 +0200 (CEST)
Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180])
 by puck1183.startdedicated.com (Postfix) with ESMTP
 for <oracle-l@orafaq.com>; Thu,  6 Jun 2013 08:36:08 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0F0B921DD9;
 Thu,  6 Jun 2013 02:23:00 -0400 (EDT)
X-Virus-Scanned: Debian amavisd-new at turing.freelists.org
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id SryiPe9CPriQ; Thu,  6 Jun 2013 02:22:59 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id EAB9B21D9E;
 Thu,  6 Jun 2013 02:22:18 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 06 Jun 2013 02:21:38 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8882421D01
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 02:21:37 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id Q4q0gdiL6kR7 for <oracle-l@freelists.org>;
 Thu,  6 Jun 2013 02:21:37 -0400 (EDT)
Received: from mx01.mgm-tp.com (mx01.mgm-tp.com [217.110.94.82])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 0100120FDA
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 02:21:36 -0400 (EDT)
Received: from pmx01.mgm-tp.com (unknown [10.0.202.41])
 by mx01.mgm-tp.com (Postfix) with ESMTP id 59EF2F88045
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 08:34:42 +0200 (CEST)
Received: from smtp-relay.mgm-tp.com (unknown [10.0.202.38])
 by pmx01.mgm-tp.com (Postfix) with ESMTP id 49FE247F56D
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 08:34:42 +0200 (CEST)
X-Trusted-binford: yes
Received: from [10.8.0.11] (unknown [10.8.0.11])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by smtp-relay.mgm-tp.com (Postfix) with ESMTPSA id 3D44B5CE922
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 08:34:42 +0200 (CEST)
Message-ID: <51B02DD4.20506@mgm-tp.com>
Date: Thu, 06 Jun 2013 08:36:04 +0200
From: Thomas Kellerer <thomas.kellerer@mgm-tp.com>
Organization: mgm technology partners GmbH
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: "oracle-l@freelists.org" <oracle-l@freelists.org>
Subject: Re: Very unstable execution plan
References: <51AEE7BF.2020709@mgm-tp.com> <CE70217733273F49A8A162EE074F64D90D48B1@exmbx06.thus.corp>
In-Reply-To: <CE70217733273F49A8A162EE074F64D90D48B1@exmbx06.thus.corp>
Content-type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.6.6.62416
X-mgm-scanner: geek value 5000
X-archive-position: 49185
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: thomas.kellerer@mgm-tp.com
Precedence: normal
Reply-To: thomas.kellerer@mgm-tp.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l

> The answer to the first part of your posting is just so cute I think
> I'll have to emulate it and write a blog about it (though it might be
> nice to see the plan, including predicate section, as pulled from
> memory by dbms_xplan). The plan is "the same" - but the later steps
> involve nested loop joins into tmp_vu_sparte by index idx_tmp_sparte
> - I'll bet the order of joining to those two copies have changed, so
> the predicates involved are different, which is why the numbers of
> rows (hence CR gets, hence CPU time) is so different.>

Yes your assumption is correct as it seems.

Now the question is: how can we convince the optimizer to do it always right?

> For the second part, check the predicate section of the plan for implicit conversions before you do anything else.

That's the first thing I checked. There are only comparisons on columns with the same datatype involved.
Not parameters (or literals) at all.

Regards
Thomas

--
http://www.freelists.org/webpage/oracle-l


