Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Index problem ?
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C0614D.11321230
Content-Type: text/plain;
charset="iso-8859-1"
if sys schema was not analyzed (and usually it shouldn't be) oracle will use RULE optimizer which will use indexes even if it is slower then doing FTS.
Alex Hillman
-----Original Message-----
From: Sukumar Kurup [mailto:sukuora_at_yahoo.com]
Sent: Friday, December 08, 2000 10:34 AM
To: Multiple recipients of list ORACLE-L
Subject: Index problem ?
Hi ,
The following query gives out results after allmost 5 minutes :
select a.table_name,a.index_name,b.bytes
from dba_indexes a, dba_segments b
where a.table_name=b.segment_name
and a.table_name='<table_name>'
and a.owner='<owner_name>' ;
However, with the last line modified to read as
and rtrim(a.owner)='<owner_name>
the result comes immediately.
I tried this on different servers/Databases, and the results are similar.
I did an explain plan on both the queries, and the notable difference was that while the first query did an index scan on OBJ$ table (one of the table used in dba_indexes view), whereas in the second query, it did a full table scan (due to the rtrim function).
Could the presence of index on obj$ table be the
reason for such a difference in the query timings ?
can Index actually slow down a query to such an extent
?
Or could there be any other reason ?
Sun solaris = 2.6
Oracle 8.1.7 & 8.1.6
Thanks in advance, for any enlightment,
Sukumar Kurup
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
------_=_NextPart_001_01C0614D.11321230
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =charset=3Diso-8859-1">
<TITLE>RE: Index problem ?</TITLE> </HEAD> <BODY>
<P><FONT SIZE=3D2>if sys schema was not analyzed (and usually it = shouldn't be) oracle will use RULE optimizer which will use indexes = even if it is slower then doing FTS.</FONT></P>
<P><FONT SIZE=3D2>Alex Hillman</FONT>
</P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT> <BR><FONT SIZE=3D2>From: Sukumar Kurup [<A = HREF=3D"mailto:sukuora_at_yahoo.com">mailto:sukuora_at_yahoo.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Friday, December 08, 2000 10:34 AM</FONT> <BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT> <BR><FONT SIZE=3D2>Subject: Index problem ?</FONT> </P> <BR> <P><FONT SIZE=3D2>Hi ,</FONT>
<P><FONT SIZE=3D2>The following query gives out results after allmost =
5</FONT>
<BR><FONT SIZE=3D2>minutes :</FONT>
</P>
<P><FONT SIZE=3D2>select a.table_name,a.index_name,b.bytes</FONT> <BR><FONT SIZE=3D2>from dba_indexes a, dba_segments b</FONT> <BR><FONT SIZE=3D2>where a.table_name=3Db.segment_name</FONT> <BR><FONT SIZE=3D2>and a.table_name=3D'<table_name>'</FONT> <BR><FONT SIZE=3D2>and a.owner=3D'<owner_name>' ;</FONT> </P>
<P><FONT SIZE=3D2>However, with the last line modified to read =
as</FONT>
</P>
<P><FONT SIZE=3D2>and rtrim(a.owner)=3D'<owner_name></FONT> </P>
<P><FONT SIZE=3D2>the result comes immediately.</FONT> </P>
<P><FONT SIZE=3D2>I tried this on different servers/Databases, and =
the</FONT>
<BR><FONT SIZE=3D2>results are similar.</FONT>
</P>
<P><FONT SIZE=3D2>I did an explain plan on both the queries, and =
the</FONT>
<BR><FONT SIZE=3D2>notable difference was that while the first query =
did</FONT>
<BR><FONT SIZE=3D2>an index scan on OBJ$ table (one of the table used = </FONT> <BR><FONT SIZE=3D2>in dba_indexes view), whereas in the second query, =it</FONT>
<BR><FONT SIZE=3D2>did a full table scan (due to the rtrim function). = </FONT> </P>
<P><FONT SIZE=3D2>Could the presence of index on obj$ table be =
the</FONT>
<BR><FONT SIZE=3D2>reason for such a difference in the query timings =
?</FONT>
<BR><FONT SIZE=3D2>can Index actually slow down a query to such an =
extent</FONT>
<BR><FONT SIZE=3D2>? </FONT> <BR><FONT SIZE=3D2>Or could there be any other reason ? </FONT> </P> <P><FONT SIZE=3D2>Sun solaris =3D 2.6</FONT><BR><FONT SIZE=3D2>Oracle 8.1.7 & 8.1.6</FONT> </P>
<P><FONT SIZE=3D2>Thanks in advance, for any enlightment,</FONT> </P>
<P><FONT SIZE=3D2>Sukumar Kurup</FONT> </P> <BR> <BR> <BR>
<P><FONT =
SIZE=3D2>__________________________________________________</FONT><BR><FONT SIZE=3D2>Do You Yahoo!?</FONT> <BR><FONT SIZE=3D2>Yahoo! Shopping - Thousands of Stores. Millions of = Products.</FONT>
<BR><FONT SIZE=3D2>-- </FONT> <BR><FONT SIZE=3D2>Author: Sukumar Kurup</FONT> <BR><FONT SIZE=3D2> INET: sukuora_at_yahoo.com</FONT> </P>
<P><FONT SIZE=3D2>Fat City Network Services -- (858) =
538-5051 FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California -- Public Internet =
access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=-----</FONT>
![]() |
![]() |