"Bill Todd" <
XXXX@XXXXX.COM>schreef in bericht
Quote
You can improve performance some by installing Manual Parma's memory
manager patch from Code Central but reading 13,000 rows across the network
will always take a lot of time.
--
Bill Todd (TeamB)
TeamB cannot answer questions received via email
Maybe I explained my test situation not well enough. Firstly lets look at my
local situation, so without the network. I take ONLY a TTable and set the
Tablename property to a paradox table which holds the 13000 records, and I
read ALL 13000 records in a dynamic array of records, which holds all the
fields. This takes about 1.5 second. I also take a TClientDataSet which I
connect to a TDataSetProvider, which in turn is connected to the
fore-mentioned TTable. I fill the TClientDataSet with ALL 13000 records,
using a value of the PacketRecords property of 1000 - this takes about 2.5
seconds.
Next I make a network connection and I put the paradox table on the network,
linking the database through the BDEAdmin to the network. When testing both
previous situation I count for the single TTable a performance of 3 seconds,
which is almost as good. For the TClientDataset is takes however 25 seconds
to fill it with all 13000 records.
I'll explain where my problem originates. The programmer who has worked on
this application before me, half a year ago, has only used TTables directly,
using several filters en lookup fields. When a user calculated a graph which
spans a whole year (which is approximatly between 1000 and 60.000 records)
all records have to be examined and added. As a consequence of this approach
this took from a few minutes to a few hours, especially when using a
network. I was able to bring this timing down to a few seconds thanks to the
approach of reading all records in an internal variable. But I have a few
problems with this approach, especially when using Master-Detail
relationships. Since the TClientDataSet is also an internal variable I
assumed this wouldnt take much longer to fill, and I was right - as far as
only a local database is used. But this week I have tested a network
situation (on my local machine, so this rules out any network problems) and
the result is very bad, as I mentioned.
I hope this clarifies my point. When my user selects a graph a new window
opens. After making a few selections he presses the Calculate button. This
starts up the calculation of the graph, which very often spans a whole year.
So it is very often needed to read in many records (for this example 13000).
When reading all the records of the table when the user presses Calculate
for the first time, it doesnt have to be read in the second time. And often
the user presses Calculate a few times with different selections. I can
choose to read in only the needed records, and especially with the
TClientDataSet this is a promising approach, but then it has to be as fast
as "normal", for when the user indeed needs all records.
Can you please help me speed up TClientDataSet?
--
Best regards, Camiel Wijffels