UDFs interact with the DB2 optimizer in important ways. Understanding access paths helps you write UDFs that do not defeat index access.