Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Interesting query

Interesting query

From: David Turner <turner_at_tellme.com>
Date: Wed, 27 Jun 2001 11:55:14 -0700
Message-ID: <F001.0033A8DA.20010627110057@fatcity.com>

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). Received on Wed Jun 27 2001 - 13:55:14 CDT

Original text of this message

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