Page 1 of 1

TVirtualTable IndexFieldNames

Posted: Thu 14 Jan 2010 15:45
by segnew
I need a fast method to locate data associated with components I create at runtime. I want everything as efficient as possible with a minimum of programming and am considering using a TVirtualTable.

As an example I have the following:
VT.IndexFieldNames := 'TableName';
VT.Locate('TableName',TargetTableName,[]);

What search method is used to locate the record?

How will performance be effected when I have a very large number of items in the table?

Also, I want to know how efficient the TVirtualTable is from a memory utilization standpoint. In some cases I just have a string(40) index and an integer. In others I have a string(40) index, an integer, and additional data that must be tracked.

How is memory allocated for new records?

Thanks

Posted: Mon 18 Jan 2010 08:30
by Plash
If you locate by a field from IndexFieldNames, VirtualTable uses optimal search method. Search can be fast even for a large number of records.

For each new record VirtualTable allocates a memory block which size is sum of fields sizes.