Subject Re: [firebird-support] Index length only 197?!!
Author Martijn Tonies
Hi,

> > We're creating an index on 2 fields as follows:
> >
> > [java] create table PRINTERGROUP (
> > [java] PG_ID numeric(18,0) not null,
> > [java] CLASS_DISC varchar(25) not null,
> > [java] NAME varchar(172),
> > [java] DELETED smallint,
> > [java] LASTDISCOVERY timestamp,
> > [java] LASTPOLICYAPPLICATION timestamp,
> > [java] SSLENABLED smallint,
> > [java] primary key (PG_ID),
> > [java] unique (CLASS_DISC, NAME)
> > [java] )
> >
> > I know the limit on an index is 252 bytes, so I was expecting to be
> > able to make Name a length of 227. However, it will only allow 172
> > (index too long error).
> >
> > Any ideas why?

Yes, there is some overhead associated with each column being added
to an index.

Use this:
http://www.volny.cz/iprenosil/interbase/ip_ib_indexcalculator.htm

Martijn Tonies
Database Workbench - development tool for Firebird and more!
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com