Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 16 Apr 2024, 22:02

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 22 Oct 2018, 09:24 
Offline

Joined: 26 Jan 2016, 09:46
Posts: 56
Hi,

We use the TreeList with the TMemTableEh / TDBGridEh object. It's really powerful and very practical.
With a simple SQL query, we can build our tree by the father / son relationship.

However, for a 4-level tree (level 0 to level 3), and a query returning approximately 3500 rows, the tree build times are quite long (about 7 seconds).
If we disable the TreeList property, it's instantaneous.
Are there any properties that we can disable or a method that we can use to improve this?

I thank you in advance

ISOAR


Top
 Profile  
 
PostPosted: 23 Oct 2018, 10:34 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

Did you try to use the recommendations described in section "Storing records in tree mode (TreeView)" of "EhLib Users Guide.doc"

-----
Adjusting TreeView mode is realized by subproperties of TMemTableEh.TreeList property. TMemTableEh automatically adds new record in the tree, using field values defined by TreeList.KeyFieldName and TreeList.RefParentFieldName properties. When new record is appearances in MemTable, it tries to find Parent record in the list of existing records, it looks throw records trying to find values of the field in KeyFieldName that is equal to the value of the field defined by RefParentFieldName property in the new record. Furthermore, it checks, if this record is a parent for other existing records in array.

Building of tree can be speeding up, if you create indexes for fields specified in TreeList.KeyFieldName and TreeList.RefParentFieldName properties.

However the maximum speed of building tree is possible to achieve if the records all records will be appended in DataSet in valid sequence. In other words every record must be added in DataSet in same order as it appears in the tree. In last case it is not recommended to create indexes, it can only slow down building of tree. If records appear in DataSet in valid order set FullBuildCheck to False. It will not check if the new record have child records in DataSet.
-----

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 09 Nov 2018, 07:47 
Offline

Joined: 26 Jan 2016, 09:46
Posts: 56
Hi,

Quote:
If records appear in DataSet in valid order set FullBuildCheck to False.

It works !!!!

Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group