You modified my code. For once please compile my code exactly as it is without changing even a single alphabet and then see the difference. I guarantee a difference in speed. BTW may I know the total number of records? Or please send me your dbf ziipped.
Rao, Will you kindly try this sample as it is without changes? Yes, there is a speed improvement: OLD 2.20 58776 NEW 1.84 58776 This is my modified sample: REQUEST DBFCDXFUNCTION MAIN()  ...
James, Agreed, but I don't see any logical way you can search for any combination of fields in a filter without reading all the records for at least some of the combinations. I've always used conditional indexes created "on the fly" with very good results. The searches demanded by my clien...
Will you kindly try this sample as it is without changes? REQUEST DBFCDXFUNCTION MAIN() FIELD CLIENTE LOCAL nSec, nKey RDDSETDEFAULT( "DBFCDX" ) FERASE( "CORSE.CDX" ) USE CORSE ...
Enrico, You want your user to search on any fields and combinations. Agreed, but I don't see any logical way you can search for any combination of fields in a filter without reading all the records for at least some of the combinations. I think the point is, that some filters will be optimized if th...
James, Consider: Assuming there is an index on client, then this should be optimized: set filter to client ="A" .or. client="M" And I don't think you can do this with scopes. Assuming that the filter above could be optimized, it would only be a specific case. Imagine a dialog ful...
Rao, If there is an index on CLIENTE then SET FILTER TO CLIENTE = "A" can be fully optimized. If there is an index on UPPER(CLIENTE) then SET FILTER TO UPPER(CLIENTE) = 'A' can be fully optimized. I don't see any speed improvement in the modified sample below. :-( REQUEST DBFCDXFUNCTION MA...
Rao, If there is an index on CLIENTE then SET FILTER TO CLIENTE = "A" can be fully optimized. If there is an index on UPPER(CLIENTE) then SET FILTER TO UPPER(CLIENTE) = 'A' can be fully optimized. If I had an index on UPPER(CLIENTE) I wouldn't need of filters at all. I would just use scope...
Because this filter SET FILTER TO FIELD -> cliente = "A" can not be optimized at all. As I said earlier, DBFCDX provides capabilities of optimization, provided the programmer wants to avail the benefits of these capabilities. In this case we can not say DBFCDX is slow. If there is an in...
Hmm, you can't compare with and without a filter to see optimization. It seems you would have to compare the filter compiled with xHarbour (with optimization) v.s. Clipper (without optimization).