Statement size or complexity exceeds server limits
Probable cause
The statement contains one or more constructs whose size make it impossible to process. Increasing the maximum cache size,
page size, or stack size may resolve this error. Consider rewriting the query so that the internal limit is not exceeded.
For example, if the query contains a large IN-list, consider inserting the IN-list's values into a temporary table. Then rewrite
the query to join this temporary table to the other table(s) in the original statement.