Informix Error -874: General exception error has occurred in the optimizer.
Cause and resolution
General exception error has occurred in the optimizer.
If this internal error occurs, note all circumstances and contact IBM Support.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-874 is flagged by the official text as an internal error in the query optimizer, with no documented application-level trigger.
- A genuine internal engine condition in the optimizer, per the official guidance's framing, with no other documented application-level cause.
- An unusually complex or edge-case query exercising an uncommon optimizer code path, plausible given the general nature of optimizer-level errors elsewhere in this reference (like -640), though not explicitly named by this error's own sparse official text.
Solutions / Resolution
- If this recurs, note all circumstances and contact IBM Support, per the official guidance — there is no documented general application-level fix.
- Try
UPDATE STATISTICSon the tables involved, as a practical first step given -640's precedent of a similar optimizer-related error being resolvable that way, even though not explicitly named for -874 itself. - Try simplifying the query, as a practical step to isolate which specific construct triggers the failure, if an unusually complex query was involved.
Examples
Trying UPDATE STATISTICS first
UPDATE STATISTICS FOR TABLE orders;
-- retry the statement that produced -874
Diagnostic Checks
- Try
UPDATE STATISTICSon the tables involved, given the precedent from -640. - Try simplifying the query if it's unusually complex.
- Capture the exact statement for escalation if neither resolves it.
Related Errors / Related Topics
- -640 — "QPlan sanity failure line-number." A related optimizer-level internal error, where
UPDATE STATISTICSis the official guidance's own documented first fix — a reasonable first step to try here too, though not explicitly named for -874.
An internal optimizer error — try UPDATE STATISTICS first (per -640's precedent), then
simplify the query before escalating to IBM Support.