Received: (qmail 2201 invoked from network); 17 Nov 2011 08:02:27 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-85-25-126-90.inaddr.ip-pool.com with SMTP; 17 Nov 2011 08:02:24 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id F1424E5990F;
 Thu, 17 Nov 2011 09:02:22 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1321538543; bh=cLgE3ztptY35PVuYMUsv/aQm1ZFOFmKi6haJSLND
 xsM=; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:
	 MIME-Version:Content-type:Content-Transfer-Encoding:Sender:
	 Reply-To:List-help:List-unsubscribe:List-Id:List-subscribe:
	 List-owner:List-post:List-archive; b=FCyMerHocRYNeQnGmJFumgcBAOHin
 IoduGDBaOVv8cK9FRKH/y2b6hAgtr6+mM/lCT/hRbWDgd0GLexarT4Ee6+tKXYsLvpi
 JGRx+gqASg1e9oVwJXhHveNQgZYucsCxJ0DPW5lnqQBgeG27jsnCA59WXW5+yZ5bXxi
 pz/kHGMc=
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
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 ydXAvTdxelnS; Thu, 17 Nov 2011 09:02:22 -0500 (EST)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 42B0AE503CD;
 Thu, 17 Nov 2011 09:01:39 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 17 Nov 2011 09:00:56 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6708AE5D8CE
 for <oracle-l@freelists.org>; Thu, 17 Nov 2011 09:00:56 -0500 (EST)
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 bmpvZkhK2ya2 for <oracle-l@freelists.org>;
 Thu, 17 Nov 2011 09:00:56 -0500 (EST)
Received: from troll.tpk.net (troll.tpk.net [216.107.198.11])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2D3A6E5D8C8
 for <oracle-l@freelists.org>; Thu, 17 Nov 2011 09:00:56 -0500 (EST)
Received: from mwf4500 (c-75-69-96-73.hsd1.nh.comcast.net [75.69.96.73])
 by troll.tpk.net (8.14.2/8.12.11) with ESMTP id pAHE0rDp001020;
 Thu, 17 Nov 2011 09:00:54 -0500
From: "Mark W. Farnham" <mwf@rsiz.com>
To: <mwf@rsiz.com>, <ChrisDavid.Taylor@ingrambarge.com>,
        "'Stephens, Chris'" <Chris.Stephens@adm.com>
Cc: <oracle-l@freelists.org>
References: <C5533BD628A9524496D63801704AE56D6A334C3EB5@SPOBMEXC14.adprod.directory> <D95BD5AFADBB0F4E9BB6C53F14D3A050057BA5A36D@JRCEXC1V1.research.na.admworld.com> <C5533BD628A9524496D63801704AE56D6A33D074D4@SPOBMEXC14.adprod.directory> <04b001cca530$67a7b880$36f72980$@rsiz.com>
In-Reply-To: <04b001cca530$67a7b880$36f72980$@rsiz.com>
Subject: RE: Strategies for dealing with (NOT EQUAL) conditions and indexes
Date: Thu, 17 Nov 2011 09:00:57 -0500
Message-ID: <053c01cca531$54f9f670$feede350$@rsiz.com>
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
Content-Language: en-us
X-archive-position: 40175
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: mwf@rsiz.com
Precedence: normal
Reply-To: mwf@rsiz.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

Argh. I sent that carefully formatted to not wrap and be proportional, but
apparently the mail chain stripped all that off and wrapped the heck out of
it.

This:

select --+ gather_plan_statistics a,d from junk13 where (a < '1' or a >'1')
and d != 'not aA'

was the key point.

-----Original Message-----
From: oracle-l-bounce@freelists.org [mailto:oracle-l-bounce@freelists.org]
On Behalf Of Mark W. Farnham
Sent: Thursday, November 17, 2011 8:54 AM
To: ChrisDavid.Taylor@ingrambarge.com; 'Stephens, Chris'
Cc: oracle-l@freelists.org
Subject: RE: Strategies for dealing with (NOT EQUAL) conditions and indexes

Okay, I did not realize the not equals was on the indexed column rather than
the non-indexed column.
 

In the following, there is an index on columns (a,b,c), and none on d. But a
is highly selective (one row in fact, since I didn't want to fool around and
find the break point).

 

The value on D is then just filtered out from the one row the index returns.
So if the costs are right, you can turn a single not equals into the
concatenation of a pair of index range scans with a table probe

instead of a fast full index scan or a full table scan.
<snip>


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


