overhead when using CDS

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

overhead when using CDS

Post by jkuiper » Wed 16 Jun 2010 15:03

If I use CDS (Clientdataset) and TMyQuery in the same application, isn't there a little overhead. As far as I can see TMyQuery read its data from the MySQL table, put them in memory and closes the table from the server. So there's no cursor open on the database table. If there will be an insert/update/delete TMyQuery creates an SQL to refresh the table on the server with the updated records.
If I using CDS in combination with TMyQuery, only the dataset is moving to another component but still in memory.

Am I right and will CDS only usefull to n-tier when I using TMyQuery?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 17 Jun 2010 10:00

When you are using TClientDataset with TMyQuery recordset is kept in memory of both components. To increase performance you can connect DataSource directly to TMyQuery.

jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Post by jkuiper » Thu 17 Jun 2010 10:15

You say: Closing TMyQuery still have records in memory. What is TMyquery.close doing? As far as I know closing the dataset and clear any records in it.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 18 Jun 2010 08:24

No, after closing TMyQuery frees memory.

jkuiper
Posts: 138
Joined: Fri 04 Aug 2006 14:17

Post by jkuiper » Fri 18 Jun 2010 15:51

Okay. Now I know I can better use TMyquery instead of TVirtualTable or CDS, because TMyQuery is doing the same thing. Only uses CDS with TMyQuery when creating a n-tier application. :D

Post Reply