Skip to content

Instantly share code, notes, and snippets.

@xtender
Created September 17, 2014 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xtender/dadf038e3b29cd448175 to your computer and use it in GitHub Desktop.
Save xtender/dadf038e3b29cd448175 to your computer and use it in GitHub Desktop.
CBO: Eliminating function calls
SQL> create function xt_func(v varchar2) return varchar2 as
2 begin
3 dbms_output.put_line('Function fired! ['||v||']');
4 return v;
5 end;
6 /
Function created.
SQL> create view xt_view as
2 select dummy a, xt_func(dummy) f from dual
3 /
View created.
SQL> select * from xt_view;
A F
--- ----------
X X
1 row selected.
Function fired! [X]
SQL> select a from xt_view;
A
---
X
1 row selected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment