Since the for-loop predicates are unfolded at run-time, the subqueries included in the for-loop predicates are also evaluated at run-time.
"The subquery``SELECT cdval FROM code_table""is compiled at compile-time, and an execution plan for the subquery is stored in an internal data structure."