Our team is running into horrible run times due to context switching efficiencies for our queries because of the use of deterministic functions.
The team is split down the middle between allocating more resources to the database and refactoring our entire architecture from deterministic functions to a sort of “deterministic view” approach, as encapsulating the logic thats in the functions into views eliminates the context switching between the PLSQL engine and the SQL engine.
We have tried using some PRAGMA statements to boost efficiencies but have had very underwhelming results.
Allocating more resources to the server seems like diminishing returns.
But refactoring all our functions to views, while requiring a significant investment in time, seems like the most logical option. While yes, im aware what im describing is not a “true” deterministic functions, and im fairly sure there is no definition of a “deterministic view” these seem like the most appropriate descriptions of what we are looking to achieve.
While a deterministic function returns a single, repeatable output for a single same input. A deterministic view would return single repeatable value for every record that matches the predicate of the view logic.
Is this advisable or is there a third option I am missing to create repeatable, encapsulated logic for quick turnaround on creating queries.