Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 15910 invoked from network); 2 Oct 2007 12:04:03 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by 69.64.49.119 with SMTP; 2 Oct 2007 12:04:00 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 901DB78AA51;
 Tue,  2 Oct 2007 13:03:55 -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 07701-05; Tue, 2 Oct 2007 13:03:55 -0400 (EDT)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 06A1278A0C8;
 Tue,  2 Oct 2007 13:03:54 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 02 Oct 2007 12:18:22 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8BBE578B7AE
 for <oracle-l@freelists.org>; Tue,  2 Oct 2007 12:18:22 -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 28932-06 for <oracle-l@freelists.org>;
 Tue, 2 Oct 2007 12:18:22 -0400 (EDT)
Received: from trinity.uptime.be (trinity.uptime.be [193.121.44.112])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5BD8E78B7B2
 for <oracle-l@freelists.org>; Tue,  2 Oct 2007 12:18:19 -0400 (EDT)
X-ASG-Debug-ID: 1191340691-1e42002e0004-JbYmij
X-Barracuda-URL: http://193.121.44.112:8000/cgi-bin/mark.cgi
Received: from ws03-exchange.iconos.be (localhost [127.0.0.1])
 by trinity.uptime.be (Spam Firewall) with ESMTP id 12D241123C1
 for <oracle-l@freelists.org>; Tue,  2 Oct 2007 17:58:12 +0200 (CEST)
Received: from ws03-exchange.iconos.be ([10.0.10.5]) by trinity.uptime.be with ESMTP id UYXT6uko49caIpgI for <oracle-l@freelists.org>; Tue, 02 Oct 2007 17:58:12 +0200 (CEST)
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C8050C.E6F85A59"
X-ASG-Orig-Subj: RE: Very Strange Query Access Plan
Subject: RE: Very Strange Query Access Plan
Date: Tue, 2 Oct 2007 17:55:21 +0200
Message-ID: <BC372EA70AC7724B9DE983CBA6D1D7E5C1222D@ws03-exchange.iconos.be>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Very Strange Query Access Plan
References: <ABB9D76E187C5146AB5683F5A07336FFE0900F@EXCNYSM0A1AJ.nysemail.nyenet>
From: "D'Hooge Freek" <Freek.DHooge@uptime.be>
To: <Thomas.Mercadante@labor.state.ny.us>,
 <oracle-l@freelists.org>
X-Barracuda-Connect: UNKNOWN[10.0.10.5]
X-Barracuda-Start-Time: 1191340692
X-Barracuda-Virus-Scanned: by Uptime Spam Firewall at uptime.be
X-archive-position: 2070
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: Freek.DHooge@uptime.be
Precedence: normal
Reply-to: Freek.DHooge@uptime.be
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
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
------_=_NextPart_001_01C8050C.E6F85A59
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Do you use a bind variable for the ssn column in the query?
If so, it could be that because of bind variable peeking you are now =
using a different access plan.
=20
regards,
=20
Freek D'Hooge
Uptime
Oracle Database Administrator
e-mail: freek.dhooge@uptime.be <mailto:freek.dhooge@uptime.be>=20
http://www.uptime.be <http://www.uptime.be/>=20
disclaimer <http://www.uptime.be/disclaimer.html>=20
=20

________________________________

Van: oracle-l-bounce@freelists.org namens Mercadante, Thomas F (LABOR)
Verzonden: di 2/10/2007 17:12
Aan: oracle-l@freelists.org
Onderwerp: Very Strange Query Access Plan



All,

=20

Running on 9.2.0.7 on Aix.

=20

I have a database table with 18 million rows in it.  There is an SSN =
column in the table.  Only 625,000 rows have an SSN populated.  I also =
have an index on this column.  Statistics on both the table and index =
are gathered nightly (using dbms_stats with the estimated and default =
sample options).

=20

Yesterday, queries against this table used the index.  Today, they do =
not.  There was no large data load overnight.  We add about 10,000 =
records per day.  This behavior has happened before where the index gets =
ignored for a day and then used the next day.

I really need to use an index here.  Queries via ssn are executed all =
day long and take 10 minutes to complete.  CPU is pegged at 99%.


What am I missing?  Maybe histograms?  Haven't used them before, so any =
suggestions would be helpful.


Thanks


Tom


------_=_NextPart_001_01C8050C.E6F85A59
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML dir=3Dltr><HEAD>=0A=
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dunicode">=0A=
<META content=3D"MSHTML 6.00.2900.3157" name=3DGENERATOR>=0A=
<STYLE>=0A=
<!--=0A=
                        =0A=
 p.MsoNormal, li.MsoNormal, div.MsoNormal=0A=
	{margin:0in;=0A=
	margin-bottom:.0001pt;=0A=
	font-size:12.0pt;=0A=
	font-family:"Times New Roman";}=0A=
a:link, span.MsoHyperlink=0A=
	{color:blue;=0A=
	text-decoration:underline;}=0A=
a:visited, span.MsoHyperlinkFollowed=0A=
	{color:purple;=0A=
	text-decoration:underline;}=0A=
span.EmailStyle17=0A=
	{=0A=
	font-family:Arial;=0A=
	color:windowtext;}=0A=
=0A=
div.Section1=0A=
	{page:Section1;}=0A=
-->=0A=
</STYLE>=0A=
</HEAD>=0A=
<BODY lang=3DEN-US vLink=3Dpurple link=3Dblue>=0A=
<DIV id=3DidOWAReplyText80695 dir=3Dltr>=0A=
<DIV dir=3Dltr><FONT face=3DArial color=3D#000000 size=3D2>Do you use a =
bind variable for the ssn column in the query?</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT face=3DArial size=3D2>If so,&nbsp;it could be that =
because of&nbsp;bind variable peeking you are now using a different =
access plan.</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>=0A=
<DIV dir=3Dltr><FONT face=3DArial size=3D2>regards,</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT face=3DArial color=3D#000000 =
size=3D2></FONT>&nbsp;</DIV></DIV>=0A=
<DIV id=3DidSignature13400 dir=3Dltr>=0A=
<DIV><FONT face=3DArial size=3D2>Freek D'Hooge</FONT></DIV>=0A=
<DIV><FONT face=3DArial size=3D2>Uptime</FONT></DIV>=0A=
<DIV><FONT face=3DArial size=3D2>Oracle Database =
Administrator</FONT></DIV>=0A=
<DIV><FONT face=3DArial size=3D2>e-mail: </FONT><A =
href=3D"mailto:freek.dhooge@uptime.be"><FONT face=3DArial =
size=3D2>freek.dhooge@uptime.be</FONT></A></DIV>=0A=
<DIV><A href=3D"http://www.uptime.be/"><FONT face=3DArial =
size=3D2>http://www.uptime.be</FONT></A></DIV>=0A=
<DIV><SPAN lang=3DEN-GB style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial; =
mso-bidi-font-size: 12.0pt; mso-fareast-font-family: 'Times New Roman'; =
mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; =
mso-fareast-language: NL-BE; mso-bidi-language: AR-SA; mso-no-proof: =
yes"><A href=3D"http://www.uptime.be/disclaimer.html"><SPAN =
style=3D"mso-bidi-font-size: 10.0pt; mso-bidi-font-family: =
Arial">disclaimer</SPAN></A></SPAN></DIV>=0A=
<DIV>&nbsp;</DIV></DIV>=0A=
<DIV dir=3Dltr><BR>=0A=
<HR tabIndex=3D-1>=0A=
<FONT face=3DTahoma size=3D2><B>Van:</B> oracle-l-bounce@freelists.org =
namens Mercadante, Thomas F (LABOR)<BR><B>Verzonden:</B> di 2/10/2007 =
17:12<BR><B>Aan:</B> oracle-l@freelists.org<BR><B>Onderwerp:</B> Very =
Strange Query Access Plan<BR></FONT><BR></DIV>=0A=
<DIV>=0A=
<DIV class=3DSection1>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">All,</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Running on 9.2.0.7 on =
Aix.</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a database table =
with 18 million rows in it. &nbsp;There is an SSN column in the table. =
&nbsp;Only 625,000 rows have an SSN populated.&nbsp; I also have an =
index on this column. &nbsp;Statistics on both the table and index are =
gathered nightly (using dbms_stats with the estimated and default sample =
options).</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT>&nbsp;</P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Yesterday, queries against =
this table used the index. &nbsp;Today, they do not.&nbsp; There was no =
large data load overnight. &nbsp;We add about 10,000 records per =
day.&nbsp; This behavior has happened before where the index gets =
ignored for a day and then used the next day.</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">I really need to use an =
index here.&nbsp; Queries via ssn are executed all day long and take 10 =
minutes to complete.&nbsp; CPU is pegged at 99%.</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><BR>What am I =
missing?&nbsp; Maybe histograms? &nbsp;Haven&#8217;t used them before, =
so any suggestions would be helpful.</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><BR>Thanks</SPAN></FONT></P>=0A=
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN =
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: =
Arial"><BR>Tom</SPAN></FONT></P></DIV></DIV></BODY></HTML>
------_=_NextPart_001_01C8050C.E6F85A59--
--
http://www.freelists.org/webpage/oracle-l


