Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Index problem ?

RE: Index problem ?

From: Alex Hillman <alex_hillman_at_physia.com>
Date: Fri, 8 Dec 2000 14:28:33 -0500
Message-Id: <10704.124102@fatcity.com>


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



Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Sukumar Kurup
  INET: sukuora_at_yahoo.com
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">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2448.0">
<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>
<BR>

<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'&lt;table_name&gt;'</FONT>
<BR><FONT SIZE=3D2>and a.owner=3D'&lt;owner_name&gt;' ;</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'&lt;owner_name&gt;</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 &amp; 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><A HREF=3D"http://shopping.yahoo.com/" = TARGET=3D"_blank">http://shopping.yahoo.com/</A></FONT> <BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Please see the official ORACLE-L FAQ: <A = HREF=3D"http://www.orafaq.com" =
TARGET=3D"_blank">http://www.orafaq.com</A></FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Author: Sukumar Kurup</FONT>
<BR><FONT SIZE=3D2>&nbsp; INET: sukuora_at_yahoo.com</FONT>
</P>

<P><FONT SIZE=3D2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) = 538-5051&nbsp; FAX: (858) 538-5051</FONT> <BR><FONT SIZE=3D2>San Diego, =
California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT =

SIZE=3D2>---------------------------------------------------------------=
-----</FONT>
<BR><FONT SIZE=3D2>To REMOVE yourself from this mailing list, send an = E-Mail message</FONT>
<BR><FONT SIZE=3D2>to: ListGuru_at_fatcity.com (note EXACT spelling of = 'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>the message BODY, include a line containing: UNSUB = ORACLE-L</FONT>
<BR><FONT SIZE=3D2>(or the name of mailing list you want to be removed = Received on Fri Dec 08 2000 - 13:28:33 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US