Subject Re: [ib-support] key size too small
Author Daniel Rail
Hi,

> Hello!

> I need to create an unique check on a table:
> alter table GROUPS
> add constraint UNIQUE_GROUP
> unique ([NAME1], [NAME2])

> This operation is not defined for system tables.
> unsuccessful metadata update.
> key size too big for index UNIQUE_GROUP.

> Both name1 and 2 are of the following domain:
> CREATE DOMAIN NAME AS
> VARCHAR(40)
> COLLATE EN_US;

> Charset is ISO8859_1

> It does not seem to me that 40 characters for a name is outrageously
> large field size. Or is it?

This should've been accepted, because the maximum key size is supposed
to be 256 bytes. But also, I think it might also depend on the page
size of your database. What is the page size that you defined?

> I'm currently using triggers for the same functionality. However it
> would be nice to use the feature intended exactly for this.

> IIRC the limit was even lower on multi-byte character sets. Again IIRC
> it was divided with max size - 3 times smaller in case of unicode_fss.
> That's not enough for even one field sometimes.

As mentioned above, the index size limit is 256 bytes.

> And now for the point - is increasing this 'key size' being considered
> in the near future?

It is considered for FB 2.0.

Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.accramed.ca)