Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Interesting query
select count(*) from a_table where a_column = (select cdk(1234567890) from dual);
Regards,
Waleed
-----Original Message-----
Sent: Wednesday, June 27, 2001 3:01 PM
To: Multiple recipients of list ORACLE-L
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: turner_at_tellme.com
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: ListGuru_at_fatcity.com (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).
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: ListGuru_at_fatcity.com (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). Received on Wed Jun 27 2001 - 14:42:21 CDT