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: Mario Yepes <pafu_at_hotmail.com>
Date: Wed, 13 Oct 1999 15:03:25 -0700
Message-ID: <380501AD.D16754A6@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 - 17:03:25 CDT

Original text of this message

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