Forum > Beginners

Dynamic array empty elements issue

<< < (3/3)

noszone:
Thank you all for heads up, I've to test all of these things. Agree, the sql query isn't near perfect. Have to say, this program was designed several years ago, and now needs new functionality. With your warming help everything is possible :D.

noszone:

--- Quote from: GetMem on February 06, 2023, 01:34:20 pm ---@noszone
When retrieving a lot of records with TSQLQuery, your heap memory may become full, leading to unpredictable behaviour.

--- End quote ---

Thanks for good advise!

TRon:

--- Quote from: dseligo on February 06, 2023, 01:01:46 pm ---One more thing.
I don't know if you use this data somewhere else, but if you have all this data in database maybe you don't need to fill all these arrays.
For me it would be much simpler to select data from database, prepared for excel.

--- End quote ---
Exactly my thought as well. E.g. a master detail relationship could be helpful as well (in case the data is stored amongst several databases).

On the other hand, if the databases are huge i can understand trying to want to peed up especially this search function although I would probably do it the other way around so that the database is iterated only once (and arrays multiple times).

dseligo:

--- Quote from: TRon on February 07, 2023, 07:25:03 am ---
--- Quote from: dseligo on February 06, 2023, 01:01:46 pm ---One more thing.
I don't know if you use this data somewhere else, but if you have all this data in database maybe you don't need to fill all these arrays.
For me it would be much simpler to select data from database, prepared for excel.

--- End quote ---
Exactly my thought as well. E.g. a master detail relationship could be helpful as well (in case the data is stored amongst several databases).

On the other hand, if the databases are huge i can understand trying to want to peed up especially this search function although I would probably do it the other way around so that the database is iterated only once (and arrays multiple times).

--- End quote ---

In example I posted database is iterated only once. I would improve searching column for 'expirydate': I'd put column index in 'license' table, so it could be also extracted from database. Then only loop would be while, to iterate through records.

Nicole:
There may be another topic: a handbrake

setlength(array, length(array)+1)

Setting the length one by one reduces the performance of your program drasticallly.
Work with blocks of e.g. 500 and delete the last part of your block, when the work is done.

Navigation

[0] Message Index

[*] Previous page

Go to full version