VirtualTable indexing

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

VirtualTable indexing

Post by FCS » Wed 04 Jul 2018 14:12

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

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: VirtualTable indexing

Post by azyk » Thu 05 Jul 2018 08:54

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.

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: VirtualTable indexing

Post by FCS » Thu 05 Jul 2018 09:18

Hello,

Thank you.

Regards
Michal

Post Reply