Subject | Re: [firebird-support] Re: Indexed used with search name='TEST' but not with name like 'TEST%' |
---|---|
Author | Anderson Farias |
Post date | 2008-04-27T18:50:33Z |
Hi,
Those plans are diferent, and that's where the problem is.
using = ::
PLAN JOIN (
WORD_1 INDEX (IDXWORD1),
IWADISOBJE_1 INDEX (IX_IWADISOBJECT_BOLD_ID))
using like/starting ::
PLAN JOIN (
IWADISOBJE_1 INDEX (IDXIWADISOBJECT1),
WORD_1 INDEX (IDXWORD3))
BUT, testing the database you sent (on FB 2.1 final) both querys have the
same PLAN (the best one) but of course since there's no data. I'd try
updating your index statistics and see what happens.
If the problem persists, try droping index IDXIWADISOBJECT1. If you really
need it, try creating it only for column BOLD_TYPE. With FB *usually* n
single field indexes work better than compound indexes. so you could only
have
someIDX1 on BOLD_TYPE and someIDX2 on BOLD_ID and *no* index on both
(BOLD_TYPE, BOLD_ID)
(the same may apply to IDXWORD1 and IDXWORD3)
HTH,
Regards
Anderson Farias
Those plans are diferent, and that's where the problem is.
using = ::
PLAN JOIN (
WORD_1 INDEX (IDXWORD1),
IWADISOBJE_1 INDEX (IX_IWADISOBJECT_BOLD_ID))
using like/starting ::
PLAN JOIN (
IWADISOBJE_1 INDEX (IDXIWADISOBJECT1),
WORD_1 INDEX (IDXWORD3))
BUT, testing the database you sent (on FB 2.1 final) both querys have the
same PLAN (the best one) but of course since there's no data. I'd try
updating your index statistics and see what happens.
If the problem persists, try droping index IDXIWADISOBJECT1. If you really
need it, try creating it only for column BOLD_TYPE. With FB *usually* n
single field indexes work better than compound indexes. so you could only
have
someIDX1 on BOLD_TYPE and someIDX2 on BOLD_ID and *no* index on both
(BOLD_TYPE, BOLD_ID)
(the same may apply to IDXWORD1 and IDXWORD3)
HTH,
Regards
Anderson Farias