*-- Have an index on these two fields: INDEX ON EMPTY (InsCommand) TAG E_InsCmd INDEX ON SearchTB TAG SearchTB SET ORDER TO *-- Scan the table SCAN FOR SearchTB = m.lcSearch AND NOT EMPTY (InsCommand) ... IF m.plError EXIT ENDIF ENDSCAN>Right now I just have an index on SearchTB. I'm thinking, do I need to try to optimize the rest of the expression, e.g. have an index on empty(InsCommand) as you suggest or use the scan for as it is or do the check inside the scan...
>scan for m.plError=.f. and SearchTB = m.lcSearch and not empty(InsCommand)>May be it would be faster to set a filtered index and do seek, when scan while?