Set the value of the QUERY_ROWS_RETURNED_LIMIT option to prevent the optimizer from rejecting queries with large result sets.
Query rejected because it exceed resource: Query_Rows_Returned_Limit
If you use this option, set it so that it only rejects queries that consume vast resources.