Page 1 of 1

VirtualTable indexing

Posted: Wed 04 Jul 2018 14:12
by FCS
Hello,

I use a VT as a sorted list for records.
At first I fill the VT with records by Append method.
I have set IndexFieldNames:='a_key';
If the IndexFieldNames has a value (like 'a_key') adding records takes a lot of time (120 sec).
If the IndexFieldNames has no a value ('') adding records takes a few seconds.

Can I adding records when the IndexFieldNames is empty and then set IndexFieldNames on required fields ?
Will the VT re-sorted after this?

Regards
Michal

Re: VirtualTable indexing

Posted: Thu 05 Jul 2018 08:54
by azyk
If the TVirtualTable.IndexFieldNames value is set for sorting, each time when a new record is added or appended, a dataset will be resorted. To avoid wasteful resorting, set IndexFieldNames value blank, add new records, and then return the previous value for IndexFieldNames. The dataset will perform one sorting.

Re: VirtualTable indexing

Posted: Thu 05 Jul 2018 09:18
by FCS
Hello,

Thank you.

Regards
Michal