I just ran these two queries:
select object_id,object_type,context_id,creation_user from acs_objects where object_id <100;
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
9 consistent gets
0 physical reads
0 redo size
2853 bytes sent via SQL*Net to client
647 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
44 rows processed
object_type here to "simulate" the name field. Now on to the PL/SQL function
select object_id,acs_object.name(object_id),context_id,creation_user from acs_objects where object_id <100;
Statistics
----------------------------------------------------------
213 recursive calls
0 db block gets
511 consistent gets
0 physical reads
0 redo size
3120 bytes sent via SQL*Net to client
647 bytes received via SQL*Net from client
4 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
44 rows processed
A recursive call occurs when one SQL statement requires the execution of a further separate SQL statement.
213 versus 0 recursive calls. 511 vs 9 consistent gets. It already *is* a huge difference for a small query - and it grows bigger the bigger your system gets.
(The get_url function is *way* worse btw).