Engwi
asked on
Delphi ListView and LARGE query
Greetings
I have a listview on my form that gets populated by records from either a flat file or SQL server database.
With the flat file for example, if the amount of records starts to exceed 10 000
the reporting becomes way to slow and GUI locks up while in the loop of retrieving the records.
Should I look at having a seperate thread doing the work ?
Iterating through the records consumes only a couple of seconds, but uncommenting the code that places the data in the listview and then running the query takes up time ?
Any suggestions ?
Regards
Engwi
I have a listview on my form that gets populated by records from either a flat file or SQL server database.
With the flat file for example, if the amount of records starts to exceed 10 000
the reporting becomes way to slow and GUI locks up while in the loop of retrieving the records.
Should I look at having a seperate thread doing the work ?
Iterating through the records consumes only a couple of seconds, but uncommenting the code that places the data in the listview and then running the query takes up time ?
Any suggestions ?
Regards
Engwi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rob
Will try that first and let you know.
Thanks
Engwi
Will try that first and let you know.
Thanks
Engwi
Have you considered turning the listview into a virtual listview?
what is virtual listview??
some suggestions
1. If you are getting total information with in few seconds, i suggest to take that info in dynamic collection classes (i.e dynamic vectors or hash tables or linked lists) say 1000 per class for example
2. Create the thread that adds the information in the list
3. create the instance to new thread, send the ppointer of collection object to the thread instance and start the thread.
4. like that call all threads at a time.
5. But take care that only 10 to 20 threads (depending on system peformance) should be in running mode. i.e at any moment of time , application execution should only support 10 to 20 threads
6. take care of syncronization to the listbox object also (if necessary)
hope you got my ideas.
Regards,
Koundinya