Marking a function as Deterministic can greatly affect query performance. See https://docs.jboss.org/author/display/TEIID/Nondeterministic+Function+Handling