Hi David,
Can you have them write the query with a variable then populate the
variable with the function?

-Rocky

--- David Turner <[EMAIL PROTECTED]> wrote:
> My users are writing many of their own functions and it is causing
> performance to suffer
> on a few simple queries. For example, I have a query that just selects
> count(*) from a
> table. With the function
> 
> select count(*) from a_table where a_column = cdk(1234567890);
> 
> It takes 5 minutes
> 
> By plugging in the result of the cdk function into the query
> 
> select count(*) from a_table where a_column = 0987654321;
> 
> It take .18 of a second.
> 
> How can I tell the optimizer that the result of the function will be the
> same every
> time so you don't need to call it for every row?  I can do this in the
> app but it would
> be cool to know if I can do this on the database side also.
> 
> Thanks, Dave
> 
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- 
> Author: David Turner
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rocky Welch
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to