Subject Re: [ib-support] index key too big
Author Paul Reeves
vsvadlenka wrote:
> I can create table with field varchar(255), but if I try to create
> index on that field, there is error message SUBJ.
> With field varchar(240) is all OK.
> I can't index fileds longer then 240?
> Is that feature or bug?

It is a feature and a bug.

It is a feature because there is little point in indexing very wide
columns. The index must store large amounts of data which means the
number of index entries per page will be less. This means the engine
must traverse many index pages to locate the data pages. In many cases
it would be as quick just to read the data pages directly.

It is a bug because character sets often take up three bytes per
character. This reduces the index width of a multi-byte character set to
around 80 chars. That is way too small and makes it difficult to
effectively use Firebird/InterBase with a mbcs.

A feature request has been logged to widen the supported index width for
Firebird. It is reasonably high priority (as it is much requested) but
there are no timescales for implementation yet.



Paul Reeves
Supporting users of Firebird and InterBase