Hi Nadya,
(just read this thread...)
The fastest way "traditional" way would probably be "overindexing" with complex indices.
This will cost you only a little bit in creating larger cdx file size. There are some objections against creating too many indices and using a column in many times in different index expressions, but since this is a readonly table, most of these are irrelevant.
For instance to walk in the insert case
[index on upper(ChildTB) + Padl(InsTrigger, 2) tag ChildIns]
set order to ChildIns
lcSeekSearch = m.lcSearch + Padl(1, 2)
if seek(lcSeekSearch)
scan while upper(ChildTB) + Padl(InsTrigger, 2) = m.lcSeekSearch for not m.plError
endscan
endif
should be the most efficient code when viewed visualing the internal commands vfp has to execute on each run.
BUT sometimes using rushmore IS faster: if vfp has results from reading the cdx on a previous check still cached and decides this cache is current enough so the index isn't read again. This beats the seek()-scan while approach. Even then using only one compound index should be faster than using 2 or more. But when using rushmored "for" take care not to have set an order.
lcSeekSearch = m.lcSearch + Padl(1, 2)
scan for upper(ChildTB) + Padl(InsTrigger, 2) = m.lcSeekSearch and not m.plError
endscan
regards
thomas