select empno, get_name(empno) from employees;
"This is an example but in my company all the developers is using same technique and complaining about slowness."
Yup...common problem. People write bad slow code...and then complain that things are bad and slow. Funny that how happens :-)
What your developers are doing is effectively re-inventing the JOIN feature in SQL with their own code. So priority #1 is to either
- educate them better, or
- get better educated developers
Having said that, some things you can look at doing as to ease the pain
1) subquery cache,
change
select empno, get_name(empno) from employees;
to
select empno, ( select get_name(empno) from dual ) from employees;
2) result cache
See
http://www.oracle-developer.net/display.php?id=504 But ultimately, go back and look at priority #1 :-)