Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: ApplyUpdates Extremely Slow


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Aug 29, 2017 6:37 PM Last Post By: Freddy Bueno Threads: [ Previous | Next ]
Eric Buescher

Posts: 15
Registered: 4/30/09
ApplyUpdates Extremely Slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 8, 2015 7:55 AM
I have a Firebird DB that I'm accessing with FireDac controls and Delphi XE6. Here is my setup
TFDConnection tied to a Firebird DB
TFDTransaction tied to the TFDConnection and the various TFDQueries
TFDQuery accessing the DB
TDatasetProvider for the TClientDataSet
TClientDataSet for local access

Everything works fine, but my CDS.ApplyUpdates take a very long time. I have played with all sorts of options within the various compoents, but can't resolve the problem. I ApplyUpdates within the external TFDTransaction, but have the same problem if using the built-in transaction control of the TFDConnection.

Here's an example. I can iterate the 7000 records of my CDS, making 6800 changes (CDS.ChangeCount) all within about 2 seconds, but the ApplyUpdates takes 17 minutes. The table being accessed is the Detail table of a Master-Detail setup, but I break the Master-Detail link before making any changes or Applying updates. I have Controls Disabled (if this matters). I also tried to speed this up by Applying the updates every 20 ChangeCounts, but this did not help.

Any ideas of what I might be missing?
Eric Buescher

Posts: 15
Registered: 4/30/09
Re: ApplyUpdates Extremely Slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 8, 2015 12:48 PM   in response to: Eric Buescher in response to: Eric Buescher
Eric Buescher wrote:
I have a Firebird DB that I'm accessing with FireDac controls and Delphi XE6. Here is my setup
TFDConnection tied to a Firebird DB
TFDTransaction tied to the TFDConnection and the various TFDQueries
TFDQuery accessing the DB
TDatasetProvider for the TClientDataSet
TClientDataSet for local access

Everything works fine, but my CDS.ApplyUpdates take a very long time. I have played with all sorts of options within the various compoents, but can't resolve the problem. I ApplyUpdates within the external TFDTransaction, but have the same problem if using the built-in transaction control of the TFDConnection.

Here's an example. I can iterate the 7000 records of my CDS, making 6800 changes (CDS.ChangeCount) all within about 2 seconds, but the ApplyUpdates takes 17 minutes. The table being accessed is the Detail table of a Master-Detail setup, but I break the Master-Detail link before making any changes or Applying updates. I have Controls Disabled (if this matters). I also tried to speed this up by Applying the updates every 20 ChangeCounts, but this did not help.

Any ideas of what I might be missing?

I think I found the problem. I changed several settings, but the one that i think actually resolved the issue was making sure all my TDataSetProvider.UpdateModes were set to "upWhereKeyOnly". I also made sure all the DSP.ResolveToDatasets were set to True, since I'm using ClientDataSets.
My 17 minutes is now down to 16 seconds.
Denis Miller

Posts: 36
Registered: 5/18/05
Re: ApplyUpdates Extremely Slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 9, 2015 7:02 AM   in response to: Eric Buescher in response to: Eric Buescher
On Thu, 8 Jan 2015 12:48:11 -0800, Eric Buescher <> wrote:


I think I found the problem. I changed several settings, but the one that i think actually resolved the issue was making sure all my TDataSetProvider.UpdateModes were set to "upWhereKeyOnly".

Are you sure that is what you want to do? UpdateMode "upWhereKeyOnly"
will update row without checking if it was changed in the meantime.
Vladimir Ulchenko

Posts: 248
Registered: 1/12/00
Re: ApplyUpdates Extremely Slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 16, 2015 4:00 AM   in response to: Eric Buescher in response to: Eric Buescher
On Thu, 8 Jan 2015 12:48:11 -0800, Eric Buescher <> wrote:

I also made sure all the DSP.ResolveToDatasets were set to True, since I'm using ClientDataSets.

ResolveToDataset controls whether provider will utilize underlying dataset (via standard TDataSet methods) to resolve applied updates or
"directly" execute DML commands in db-backend via IProviderSupport::PSExecute etc.

--
Vladimir Ulchenko aka vavan
Freddy Bueno

Posts: 11
Registered: 10/15/03
Re: ApplyUpdates Extremely Slow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 29, 2017 6:37 PM   in response to: Eric Buescher in response to: Eric Buescher
Eric Buescher wrote:
I have a Firebird DB that I'm accessing with FireDac controls and Delphi XE6. Here is my setup
TFDConnection tied to a Firebird DB
TFDTransaction tied to the TFDConnection and the various TFDQueries
TFDQuery accessing the DB
TDatasetProvider for the TClientDataSet
TClientDataSet for local access

Everything works fine, but my CDS.ApplyUpdates take a very long time. I have played with all sorts of options within the various compoents, but can't resolve the problem. I ApplyUpdates within the external TFDTransaction, but have the same problem if using the built-in transaction control of the TFDConnection.

Here's an example. I can iterate the 7000 records of my CDS, making 6800 changes (CDS.ChangeCount) all within about 2 seconds, but the ApplyUpdates takes 17 minutes. The table being accessed is the Detail table of a Master-Detail setup, but I break the Master-Detail link before making any changes or Applying updates. I have Controls Disabled (if this matters). I also tried to speed this up by Applying the updates every 20 ChangeCounts, but this did not help.

Any ideas of what I might be missing?

Hello, after 2 years am having the same issue. how do you solve them?

I am experiencing the sensation that firedac is slow in a 3-tier world., working with datasetprovider and clientdataset.

maybe is a singkle setup in firedac components, but I don't know. DBExpress were faster in inserts and updates.
for example, clientdataset.applyupdates has 30 changes, for 30 records, and the complete applyupdates takes more than 3 seconds. (is too long if you think on 3000 changes).

somody can help???
XE10

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02