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: Performance problem: anything else I can do to make this faster?

Re: Performance problem: anything else I can do to make this faster?

From: <nilendu_at_nilendu.com>
Date: 2 Mar 2005 13:30:52 -0800
Message-ID: <1109799052.789107.250590@o13g2000cwo.googlegroups.com>


SELECT count(*) FROM
employee emp,
employee_category_link link
where

    emp.id = link.employee_id
and emp.department_id = 40101
AND link.category_id = 7
AND emp.type_id = 2;

For this query - "if I were optimizer" - I'd

(a) first filter emp or link based on

(b) use a single column or leading column on a composite index on
emp.id (and link.category_id)

Try using an ORDERED hint after figuring out which is more selective. You may also want to generate histograms for these columns (since you're not using bind variables here) - so Oracle can take a better decision regarding which indexes to use. Received on Wed Mar 02 2005 - 15:30:52 CST

Original text of this message

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