Hi CoreLab team
suppose you have a table with >= 1000,000
when you want to locate a record that accidental in a last last record in
your table, Locate very very slow to find this record !!!!
Example :
T1 : (Filed1, Field2, ...) (Field1 is PK)
Table Values :
1,....
2,....
3,....
4,....
.
.
.
.
1000000,...
Now :
T1.Locate('Field1', 1000,000, []) -> Very Very Slow
( Please dont tell me to use Query for found this record ! )
Thanks for your Advice and your the best of the best Packages
Locate very slow when table record > 1000,000 rec
Locate Field1
Did you specified Field1 in the IndexFieldNames property of your Dataset?
Trianon is right. Specifying Field1 in IndexFieldNames will improve performance of locate operations. This happens because SDAC builds index by fields specified in IndexFieldNames and performs the binary search using this index.
Also when you open a dataset in FetchAll=False mode, the first call to Locate will be slow because it forces fetch for all records.
Also when you open a dataset in FetchAll=False mode, the first call to Locate will be slow because it forces fetch for all records.