Subject Quick search on large Varchar?
Author Bjoern Reimer
Hi,


I've to synchronies an X.500 (LDAP) Directory with some DB tables.
Keys in X.500 are DNs with more than 100 chars but with a very hi
difference in the first chars (there are the names, followed by
organisations).

I can't change the synchronization order from db to LDAP as there
are more targets for data than the db.

So I've build a trigger to copy 84 chars (longest varchar in
ISO8859_1) into another field on which I've put an index.

Problem: In Firebird until 1.5 I've found nothing to use this
index on my DN-Field in Database. Therefore every SELECT on an DN
causes about 40.000 unindexed reads and also the method


SELECT "Id" from USERS WHERE SUBSTRING(:LDAPDN from 1 for 84) =
USERS.SHORTDN AND :LDAPDN = USERS.DN

has the same result.

How can I get firebird to use my index? Subselect? Or do I 've to
cache al the data in perl hashes? :-(


regards

Björn