Informix Error -640: QPlan sanity failure line-number.
Cause and resolution
QPlan sanity failure line-number.
Running UPDATE STATISTICS might fix this internal error. If the error recurs, note all circumstances and contact IBM Informix Technical Support.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-640 is flagged by the official text as an internal error in the query plan (QPlan) the optimizer
built for a statement — unusually among the sparse internal-error family, the official guidance
offers a specific, concrete first thing to try: running UPDATE STATISTICS might fix it.
- Stale or missing statistics causing the optimizer to build a query plan that fails an
internal sanity check — the plausible mechanism behind the official guidance's
UPDATE STATISTICSsuggestion. - A genuine internal optimizer condition, per the official guidance's framing, with no other
documented application-level cause if
UPDATE STATISTICSdoesn't resolve it.
Solutions / Resolution
- Run
UPDATE STATISTICS, per the official guidance, as the first and most concrete thing to try:
or, more broadly, across the tables involved in the failing statement.UPDATE STATISTICS FOR TABLE orders; - If this recurs after running
UPDATE STATISTICS, note all circumstances and contact IBM Informix Technical Support, per the official guidance. - Capture the specific
line-numberreported in the error message alongside the failing statement, for escalation ifUPDATE STATISTICSdoesn't resolve it.
Examples
Running UPDATE STATISTICS first
UPDATE STATISTICS FOR TABLE orders;
-- retry the statement that produced -640
Diagnostic Checks
- Check how long it's been since
UPDATE STATISTICSlast ran on the tables involved in the failing statement, before escalating. - Capture the
line-numberfrom the error message and the exact failing statement for escalation if statistics don't resolve it.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -640 in this set yet.
Unlike most internal errors in this range, the official guidance names a specific first fix to
try — run UPDATE STATISTICS before escalating.