This content has been marked as final. Show 3 replies
As far as I know, PL/SQL (whether stored procedure or anonymous block) runs with optimizer_goal ALL_ROWS by default.
This may be different from your current session.
As you don't specify any information like database version, it is difficult to tell what is going on.
Tracing the session is in order.
In fact, this would have been the first step prior to post his.
This probably would result in two different explain plans, and those would provide more clues.
Obviously, what is in those homegrown packaged functions is also important.
Senior Oracle DBA
I am running on "Oracle9i Enterprise Edition Release 126.96.36.199.0 - Production".
The homegrown function converts the given date into GMT based on the timezone. In the eg I have is 'US/CENTRAL' and the code is as below.
if strtimezone = 'us/central' then
select datein - numtodsinterval(
(extract(timezone_hour from to_timestamp(to_char(corrected_datein,'dd-mon-yy hh:mi:ss am'))
at time zone 'us/central')),'hour') into dateout