Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Context Switching performance issue

User_POZ94Apr 23 2021 — edited Apr 23 2021

Hi Gurus,
we need to use a function in the Cursor query of the pl/sql procedure. However the function is taking 2-3 seconds to return data. The same SQL used inside the Function completes within milliseconds when run outside function directly. So we are unable to understand why the function execution is almost 100-200 times slower than the SQL execution.

Please help us to understand if this is something related to the database on how the context switching is performing. is there a way to optimize the context switching? or is this any coding issue? I have not provided the code here as I want to keep this a generic question.

Our database version is Oracle 19.

Regards,
Sam

Comments
Post Details
Added on Apr 23 2021
7 comments
2,966 views