Subject RE: [ib-support] key size too big for index
Author Leyne, Sean
> I guess I'm not understanding the size of index keys.
>
> CREATE TableFoo (
> id INTEGER,
> foo VARCHAR(120),
> bar VARCHAR(120) );
>
> CREATE INDEX tableFoo_foo ON TableFoo(foo);
>
>
> This fails telling me that the key size is too big. What
> exactly is the limit for VARCHAR keys?

What charset are you using for the table/database?

Index Keys are limited to 252 (or is it 242? -- I can't recall exactly)
*bytes*, which in the case of a three-byte charset would result in
VARCHAR(120) needing 362 bytes!


Sean