Informix Error -2989
-2989 The column name is a reference column, but it is not indexed.
It is recommended that reference columns be indexed for lookups. Performance will be much improved by creating an index.You have defined the indicated column as a reference column using the LOOKUP attribute. Whenever the operator enters a value in the field, it will be looked up in this column. Such a lookup operation is quick when an index is present, but no index on the column exists at this time. Without one, a lookup might be extremely slow. Unless the field does not allow operator input (in which case you should remove the asterisk) or the table is very small (a few dozen rows at most), you should create an index for this column before you put the form into use.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2989 is a compiler warning about a performance risk, not a hard error — per the official
guidance, a column marked as a reference column via the LOOKUP attribute is looked up every
time the operator enters a value in the field, and without an index that lookup can be
extremely slow.
- A
LOOKUP-attribute reference column with no index defined on it, per the official guidance — the direct cause.
Solutions / Resolution
- Create an index on the reference column, per the official guidance, unless the field doesn't allow operator input (in which case remove the asterisk instead) or the table is very small (a few dozen rows at most).
Examples
Adding the missing index
CREATE INDEX idx_item_item_code ON item (item_code);
Diagnostic Checks
- Check whether the
LOOKUPreference column has an index, and either create one, remove the marker if the field disallows entry, or confirm the table is small enough that the lack of an index is acceptable.
Related Errors / Related Topics
- -2920 — "The column column is a dominant column but it is not indexed." A closely
related performance warning, about a dominant verify-join column rather than a
LOOKUPreference column. - -2970 — "The column name joins with other columns, but it is not indexed." A related
performance warning, about a general join column rather than a
LOOKUPreference column.
A LOOKUP reference column has no index — create one, unless the field disallows entry or the
table is very small.