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: vendor sql tuning

Re: vendor sql tuning

From: Chris Stephens <cstephens16_at_gmail.com>
Date: Fri, 15 Jul 2005 09:47:15 -0400
Message-ID: <d95e860705071506472b1e29ad@mail.gmail.com>


There is a unique index case_id(case_id,address_id,company_id) that needs to be used.
Each case_id is actually unique.
as soon as i drop the

SELECT DISTINCT associated_address.case_id

     FROM associated_address, address
    WHERE (address.company_id= associated_address.company_id

         AND address.address_id =associated_address.address_id
         AND address.company_id = 'SYS'
         ANDaddress.last_name = 'Plaugher'
         AND address.postal_code = '45804' ))

piece out of the query it returns sub second.

SQL> desc associated_address;
 Name Null? Type

 SQL> desc case_id
 Name Null? Type SQL> desc address
 Name Null? Type  SQL> On 7/15/05, amit poddar <amit.poddar_at_yale.edu> wrote:
> Could you also provide access and filter predicate information from the
> explain plan
>
> amit
>
> Chris Stephens wrote:
>
> >in spite of the odd responses, i'm still working on this if anyone has
> >any suggestions.
> >
> >i simply cannot get it to use the index without full scanning it.
> >...when i take the order by part out and hint it to use the index it
> >still full scans
> >
> >i broke the sql down:
> >
> >SQL> SELECT address.address_id
> > 2 FROM clorox_prod.address
> > 3 WHERE (address.company_id = 'SYS'
> > 4 AND address.last_name = 'Plaugher');
> >
> >A
> >
>
>
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jul 15 2005 - 08:49:17 CDT

Original text of this message

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