Subject Re: how do i speed this up?
Author martinknappe
Ok, thank you..now I really have a problem
What I *could* of course do is only create my 1-field index on asterm
and then instead of writing

"order by asterm ascending, id ascending"

write

"order by asterm"

but the problem I'm having with this approach is the following:

what happens when there are 2 or more records with the same value for
asterm? in what order will they appear if i leave out the "id
ascending" part? will it be random (bad) or will firebird use another
internal (and consistent) criterion for ordering two "equal" records?

thanx,

martin

--- In firebird-support@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@...> wrote:
>
> I don't know whats wrong with your understanding (I don't understand
> the calculation of key length), but
> http://www.volny.cz/iprenosil/interbase/ip_ib_indexcalculator.htm
> agrees with Firebird. Try a length of 64 or less...
>
> HTH,
> Set
>
> --- In firebird-support@yahoogroups.com, "martinknappe" wrote:
> > Hi Adam, hi Set,
> > thanx for your replies. Creating a joint index on asterm, id sounds
> > very much like a plan. I just tried to do that with:
> >
> > CREATE INDEX DICENTRIES_IDX1
> > ON DICENTRIES (ASTERM,ID)
> >
> > And this is what I get:
> >
> > key size exceeeds implementation restriction for index
> > "DICENTRIES_IDX1"
> >
> > I thought this may have to do with the fact that I am using
> > unicode_fss code point ordering on a field that may contain up to 80
> > characters and that the combined index of asterm, id may be too
> > big..
> >
> > given the fact that creating an index on asterm alone works fine, i
> > thought the extra 4 bytes from field id seem to be what makes this
> > combined index too big; so what i did was simply reduce the size of
> > field asterm from 80 characters to 70 characters (thereby reducing
> > the potential index size by 30) and try again - > and i'm still
> > getting this error!
> >
> > how come it's fine to create an index on an 80-bytes varchar field
> > alone, but not, to create a combined one on a 70-bytes varchar field
> > and a 4-byte integer? what am i doing wrong here?
> >
> > thanx very much,
> >
> > martin
> >
> > ps: i'm using firebird 1.5
>