Re: slow select execution
Date: Thu, 11 Oct 2001 21:07:25 +0200
Message-ID: <3BC5EDED.31DD6309_at_home.nl>
Christian wrote:
>
> Hi
>
> we launched the following select :
> select * from fact.access_control wher ac_inst_nm = '003670029'
>
> this select is executed in 0.02 seconds
>
> the following select goes a lot slower (3 seconds ! ! !)
>
> select * from fact.access_control where ac_inst_nm = '003670029' and
> ac_obj_type = 256
>
> we also tried (without a faster response) :
> select * from fact.access_control where ac_obj_type = 256 and
> ac_inst_nm = '003670029'
>
> oracle 8.1.5
> key on ac_inst_nm
> key on ac_inst_nm, ac_xcb, ac_obj_type, ac_xxx
>
> Can anyone give me some hints to get these answers as fast as with the
> first select ?
>
> Thanks
>
> Christian
1st query uses index, 2nd does not (which to use?)
How about using an inline view?
select * from
( select * from fact.access_control
where ac_inst_nm = '003670029') a,
fact.access_control b
where b.ac_obj_type = 256;
-- Gtrz, Frank van BortelReceived on Thu Oct 11 2001 - 21:07:25 CEST