Informix Error -610: Index not allowed on TEXT or BYTE columns.
Cause and resolution
Index not allowed on TEXT or BYTE columns.
This CREATE INDEX statement names a column of the TEXT or BYTE type; however, these types are not supported for indexing. Because no defined lexical ordering exists for these types, the database server does not know how to sort or compare them. Therefore it cannot build an inverted index. Possibly you understand the data well enough to understand how to extract an ordered set of key values from it. If so, perform the extraction into a separate column in the same table, and index that column.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-610 fires when CREATE INDEX names a TEXT/BYTE column — per the official guidance, these
types have no defined lexical ordering, so the server has no way to sort or compare values of
these types and therefore can't build an inverted index on them.
CREATE INDEXdirectly naming aTEXT/BYTEcolumn — the direct, only cause.- An attempt to make BLOB content searchable via an ordinary index, without realizing the type itself doesn't support the comparison operations an index depends on.
Solutions / Resolution
- Extract an ordered set of key values from the BLOB content into a separate column, per the official guidance, if the application understands the data well enough to define a meaningful ordering — then index that column instead.
- Index a derived/summary column instead of the raw
TEXT/BYTEcolumn — for example, a hash, a prefix extracted at insert time, or a searchable summary field populated alongside the BLOB. - Don't attempt to index the
TEXT/BYTEcolumn itself under any circumstances, since the restriction is structural (no lexical ordering), not a size or configuration limit that can be worked around directly.
Examples
The disallowed attempt
CREATE INDEX idx_content ON documents (content);
-- -610: content is TEXT, which has no defined ordering to index
Indexing a derived column instead
ALTER TABLE documents ADD content_key VARCHAR(100);
-- populate content_key at the application level (e.g. a prefix or hash of the
-- BLOB's content, computed after reading it out through the locator), since
-- Informix has no built-in function that converts TEXT/BYTE directly into an
-- indexable type -- extracting a derived value needs application code or a
-- user-defined routine (DataBlade, Java UDR, or C UDR), not a built-in SQL
-- expression, given -608/-609's restriction on converting TEXT/BYTE at all.
CREATE INDEX idx_content_key ON documents (content_key);
Diagnostic Checks
- Confirm the column named in the failing
CREATE INDEXis actually declaredTEXT/BYTE, and identify what property of that content the index was actually meant to support (exact match, prefix search, etc.) before designing a derived column to index instead.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -610 in this set yet.
A structural limitation, not a configuration one — extract an orderable value into a separate
column and index that instead of the raw TEXT/BYTE column.