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

Home -> Community -> Usenet -> c.d.o.server -> Re: Where question

Re: Where question

From: Willem van der Gryp <w.vandergryp_at_worldnet.att.net>
Date: Wed, 13 Oct 1999 22:41:01 -0500
Message-ID: <7u3gj8$ga1$1@bgtnsc02.worldnet.att.net>


I presume RBO => Rule based optemizer and CBO is the Cost based optemizer. RBO was used for releases < 7.2? and from 7.2 > oracle allowed you to use a cost based optemizer. Basically what these tools do will execute your select faster and better.

According to your index the select should use the index because normally if you got the the first column for the index in your where clause then it will autoamtically use the index.

Mario Yepes wrote in message <380501AD.D16754A6_at_hotmail.com>...
>Sorry, but... what is RBO and CBO?
>I asked this about the WHERE, because I remember in Oracle 6 it takes the
>order from the bottom to the top. But now someone told me that is
>different.
>Could someone explain this two things?
>
>Thanks
>mario
>
>michael_bialik_at_my-deja.com wrote:
>
>> Hi.
>>
>> If you are using RBO then it will use index.
>> For CBO it will use the index as well assuming you have
>> a non-trivial amount of data.
>> Use EXPLAIN to verify the index usage.
>> You may use hints to "push" optimizer to use index :
>> SELECT /*+ FIRST_ROWS */ *
>> FROM emp
>> WHERE emp_id = 'XXX' AND salary > 10000
>>
>> SELECT /*+ index(emp) */ *
>> FROM emp
>> WHERE emp_id = 'XXX' AND salary > 10000
>>
>> The order of fields does not matter.
>>
>> HTH. Michael.
>>
>> In article <3804A345.89870870_at_hotmail.com>,
>> Mario Yepes <pafu_at_hotmail.com> wrote:
>> >
>> > --------------007269B43262A618446BA508
>> > Content-Type: text/plain; charset=us-ascii
>> > Content-Transfer-Encoding: 7bit
>> >
>> > Hi !!
>> >
>> > I have an idiot question, suppose that I have a table with these
>> fields:
>> >
>> > empl_id, name, address, zipcode, salary
>> >
>> > And an index by empl_id, salary
>> >
>> > How I should use the where clause to "take or use" that index
>> >
>> > where empl_id = 'xxx'
>> > and salary > 10000;
>> >
>> > or
>> >
>> > where salary > 10000;
>> > and empl_id = 'xxx';
>> >
>> > Regards,
>> > Diego
>> >
>> > --------------007269B43262A618446BA508
>> > Content-Type: text/html; charset=us-ascii
>> > Content-Transfer-Encoding: 7bit
>> >
>> > <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
>> > <html>
>> > Hi !!
>> > <p>I have an idiot question, suppose that I have a table with these
>> fields:
>> > <br>empl_id, name, address, zipcode, salary
>> > <p>And an index by empl_id, salary
>> > <p>How I should use the <b>where</b> clause to "take or use" that
>> index
>> > <p>where empl_id = 'xxx'
>> > <br>&nbsp;&nbsp; and&nbsp; salary > 10000;
>> > <p><b>or</b>
>> > <p>where salary > 10000;
>> > <br>&nbsp;&nbsp; and empl_id = 'xxx';
>> > <p>Regards,
>> > <br>Diego</html>
>> >
>> > --------------007269B43262A618446BA508--
>> >
>> >
>>
>> Sent via Deja.com http://www.deja.com/
>> Before you buy.
>
Received on Wed Oct 13 1999 - 22:41:01 CDT

Original text of this message

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