Subject Re: [firebird-support] INDEXes for a Query
Author Uwe Oeder
Thanks Helen.

Would it help if I :
No.1 Use the CONTAINING clause instead of LIKE ('% %') ?
No.2 In my program convert my search terms to uppercase and leave out one UPPER
eg. UPPER(W.WPName) CONTAINING ('OEDER')

Can I generate a PLAN to actually speed up this query.

You said : " W.CityVBSQ = 200 /* will use an index but no good if
selectivity is bad */"
This is the index on the foreign key how do I see if it is good or bad ?

Index RDB$FOREIGN7 (5)
Depth: 2, leaf buckets: 109, nodes: 73415
Average data length: 0.00, total dup: 73205, max dup: 26867
Fill distribution:
0 - 19% = 0
20 - 39% = 0
40 - 59% = 0
60 - 79% = 0
80 - 99% = 109

You said for WPName and WPDescription indexes will not help. Would indexes
actually help if I changed the search criteria to:

UPPER(W.WPName) LIKE ('OEDER%')
or
UPPER(W.WPName) LIKE ('% OEDER%')

so that the database engine can determine that a word starts with
, looking at example above , 'OEDER' ?