Informix Error -2845: The composite column for table table-name containing column column is not indexed. Performance will be much improved by creating an index on the column.
Cause and resolution
The composite column for table table-name containing column column is not indexed. Performance will be much improved by creating an index on the column.
The presence of an index can greatly reduce the time that is needed to join tables. However, an index is not essential, especially when the tables are small, or during initial testing.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-2845 is a performance warning, not a hard error: it fires when a composite (join) column isn't indexed — per the official guidance, indexing substantially improves join efficiency, though it remains optional, particularly for small tables or during development.
- A composite/join column with no index, per the official guidance — the direct, only condition; not itself disallowed, just flagged as a performance concern.
Solutions / Resolution
- Create an index on the named column, per the official guidance, if the performance improvement is worth it for this table's size and usage.
- Leave it unindexed during development, or for small tables, per the official guidance's own framing, where the performance impact is negligible.
Examples
Creating the suggested index
CREATE INDEX idx_orders_status ON orders (status);
Diagnostic Checks
- Check whether the named column is genuinely a frequent join/composite key in production use, and weigh the cost/benefit of adding an index.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -2845 in this set yet.
A performance warning, not a hard error: an unindexed composite/join column — index it if the table's size/usage warrants it.