We performed several additional test and found out that when executing the Mendix generated SQL directly in Oracle (via PLSQLDeveloper) the first time took 0.2s and the second time 800+ seconds, third, forth etc took about 0.2s again. After some googling we suspected that this could be caused by a cardinality issue in Oracle.
It should be possible to avoid this by using the hidden setting: _OPTIMIZER_USE_FEEDBACK' = 'FALSE' but we were not able to find / edit this in Oracle 12.1.0.2.0.
Apparently simular result can be achieved bij changing setting below: optimizer_adaptive_reporting_only parameter = TRUE We tried this and it works for us. We are not sure yet whether this has impact on other queries