Informix Error -517
-517 The total size of the index is too large or too many parts in
index.All database servers have limits on the number of columns that can be included in an index and on the total number of bytes in a key (the sum of the widths of the columns). This CREATE INDEX statement would exceed that limit for this database server. IBM Informix Dynamic Server and IBM Informix Universal Server allow 16 key parts (columnar or functional) and a width of 390 bytes on a 2K page platform. On 4K page platforms or using a non-default page size allows greater than 390 bytes for the width of indexed columns. IBM Informix SE supports 8 columns and a width of 126 bytes. Other Informix database servers allow 16 columns and 255 characters.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-517 is a hard limit on index key size and column count, enforced by CREATE INDEX (and
constraint-driven indexes created implicitly by PRIMARY KEY/UNIQUE).
- Too many columns in a composite index — per the official guidance, IBM Informix Dynamic Server / Universal Server allow up to 16 key parts (columnar or functional).
- Total key width exceeding the page-size-dependent byte limit — per the official guidance, 390 bytes on a 2K-page platform, with more headroom on 4K-page or non-default page-size platforms; IBM Informix SE caps at 126 bytes across 8 columns; other Informix servers allow 16 columns and 255 characters.
- Wide
VARCHAR/CHARcolumns included in a composite index without accounting for how quickly their declared widths sum toward the byte limit, especially across several columns.
Solutions / Resolution
- Reduce the number of columns in the index, per the official guidance's stated part-count limits, if the index has more key parts than the platform allows.
- Reduce the width of the columns included, per the official guidance, particularly variable- length columns declared wider than the index actually needs to distinguish rows.
- Move to a larger page size for the dbspace holding the index, per the official guidance, since 4K (or larger, non-default) pages raise the byte-width ceiling above the 2K-page default of 390 bytes.
- Consider a functional index over a computed/truncated expression instead of indexing full wide columns directly, if the full column values aren't all needed for the index's purpose.
Examples
Exceeding the limit
CREATE INDEX idx_wide ON documents (title, author, publisher, isbn, summary);
-- -517: combined key width exceeds this platform's limit for the dbspace's page size
Narrowing the index
CREATE INDEX idx_narrow ON documents (title, author, isbn);
Diagnostic Checks
- Sum the declared widths of the columns in the proposed index and compare against the platform's documented limit for the dbspace's page size.
- Count the columns/expressions in the proposed index against the 16-key-part (or 8, on Informix SE) limit.
- Check the dbspace's page size if the width limit is the binding constraint, since a larger page size raises the ceiling.
Related Errors / Related Topics
No closely related error codes are cross-referenced for -517 in this set yet.
A hard platform limit on index key width and column count — narrow the index, or move it to a dbspace with a larger page size, rather than trying to work around the limit another way.