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 5D89219602D5
 for <oracle-l@orafaq.com>; Thu,  6 Jun 2013 11:56:14 +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 11:56:14 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 994932214B;
 Thu,  6 Jun 2013 05:43:04 -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 4BAecMPmCPYO; Thu,  6 Jun 2013 05:43:04 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7CACA22102;
 Thu,  6 Jun 2013 05:42:23 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 06 Jun 2013 05:41:42 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4542E220C8
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 05:41:42 -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 KNVtlxvzHhmc for <oracle-l@freelists.org>;
 Thu,  6 Jun 2013 05:41:42 -0400 (EDT)
Received: from smtp.demon.co.uk (mdfmta008.mxout.tbr.inty.net [91.221.168.49])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B8AD2220BE
 for <oracle-l@freelists.org>; Thu,  6 Jun 2013 05:41:41 -0400 (EDT)
Received: from mdfmta008.tbr.inty.net (unknown [127.0.0.1])
 by mdfmta008.tbr.inty.net (Postfix) with ESMTP id CCFA325C0A4;
 Thu,  6 Jun 2013 10:54:47 +0100 (BST)
Received: from mdfmta008.tbr.inty.net (unknown [127.0.0.1])
 by mdfmta008.tbr.inty.net (Postfix) with ESMTP id B17F025C0AC;
 Thu,  6 Jun 2013 10:54:47 +0100 (BST)
Received: from HVUT01.thus.corp (unknown [91.221.168.12])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by mdfmta008.tbr.inty.net (Postfix) with ESMTP;
 Thu,  6 Jun 2013 10:54:47 +0100 (BST)
Received: from EXMBX06.thus.corp ([169.254.6.102]) by HVUT01.thus.corp
 ([192.168.70.41]) with mapi id 14.01.0355.002; Thu, 6 Jun 2013 10:54:47 +0100
From: Jonathan Lewis <jonathan@jlcomp.demon.co.uk>
To: "huanshengchen@gmail.com" <huanshengchen@gmail.com>,
 "thomas.kellerer@mgm-tp.com" <thomas.kellerer@mgm-tp.com>
CC: "oracle-l@freelists.org" <oracle-l@freelists.org>
Subject: RE: Very unstable execution plan
Thread-Topic: Very unstable execution plan
Date: Thu, 6 Jun 2013 09:54:46 +0000
Message-ID: <CE70217733273F49A8A162EE074F64D90D4B2C@exmbx06.thus.corp>
References: <51AEE7BF.2020709@mgm-tp.com>
 <CE70217733273F49A8A162EE074F64D90D48B1@exmbx06.thus.corp>
 <51B02DD4.20506@mgm-tp.com>,<CAM_ddu_wEOZ8xP7GVC9UEtnuXJiHrnieuJ=3aYKKstZ_7r4=SA@mail.gmail.com>
In-Reply-To: <CAM_ddu_wEOZ8xP7GVC9UEtnuXJiHrnieuJ=3aYKKstZ_7r4=SA@mail.gmail.com>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [86.162.204.193]
Content-type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
X-MDF-HostID: 5
X-archive-position: 49188
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: jonathan@jlcomp.demon.co.uk
Precedence: normal
Reply-To: jonathan@jlcomp.demon.co.uk
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


Sidney,
Column group statistics won't help in this case - they're only effective for equalities, and the joins involving two of the columns are range-based (>, <, etc).

Thomas,

I didn't see the attachment with the plans and predicates that you mentioned in an earlier post. Can you post them in-line. (All three - with stats, without stats, and with "german" index).  The complete definition of the view would also be helpful - the section you sent didn't give us any clues about how pop_info was joined.

As far as stats go - I've often seen Oracle do better without than with; but more specifically I've seen it to better if you get rid of histograms. How are you collecing stats on the critical table, and what do the stats look like ?


Regards
Jonathan Lewis

________________________________________
From: oracle-l-bounce@freelists.org [oracle-l-bounce@freelists.org] on behalf of Sidney Chen [huanshengchen@gmail.com]
Sent: 06 June 2013 09:09
To: thomas.kellerer@mgm-tp.com
Cc: oracle-l@freelists.org
Subject: Re: Very unstable execution plan

The cardinality for both plan is not correct, look at the card field for
the IDX_TMP_VU_SPARTE and TMP_VU_SPARTE. it's card = 1. Seems it's due to
the combination of 3 column in the predicate(VERTRAG_EXT_REF,
DEKLARATION_GUELTIG_BIS, DEKLARATION_GUELTIG_VON). The default statistics
can not handle such cardinality well for combined columns predicate.
Dynamic sampling is good in such case, otherwise, you may want to create
extended statistics on (VERTRAG_EXT_REF, DEKLARATION_GUELTIG_BIS,
DEKLARATION_GUELTIG_VON) and (VERTRAG_EXT_REF, DEKLARATION_GUELTIG_VON,
DEKLARATION_GUELTIG_BIS).--
http://www.freelists.org/webpage/oracle-l


