Re: SQL: optimization/func(index_k)

From: Saad Ahmad <sahmad_at_mfa.com>
Date: 9 Mar 1995 04:30:19 GMT
Message-ID: <3jm08r$t4d_at_homer.alpha.net>


Saad Ahmad (sahmad_at_mfa.com) wrote:

> select something
> from the_table
> where
> some_func_giving_shift(sysdate) = 'shift_to_find' and
> S.SYSDAT between to_date($day_s, 'YYYY/MM/DD HH24MISS')
> and to_date($day_e, 'YYYY/MM/DD HH24MISS')
> --index on SYSDAT exists
 

> The query does not use index since a function is applied to sysdat.
> The function returns '1', '2', or '3' depending on the "time" part

Its me again ...
would this work ...
selecy something
from the_table t2, the_table t1
where

       some_func_giving_shift(t2.sysdat) = 'shift_to_find' and
       t2.rowid = t1.rowid   and
       t1.sysdat between ... and ...;


--
**************************************************************
*                          Saad Ahmad                        *
*                          E-Mail: sahmad_at_mfa.com            *
**************************************************************
Received on Thu Mar 09 1995 - 05:30:19 CET

Original text of this message