Optimizing MyQuery and MyConnection objects

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
crosse
Posts: 1
Joined: Wed 25 Oct 2006 22:21

Optimizing MyQuery and MyConnection objects

Post by crosse » Wed 25 Oct 2006 22:33

I was wondering what are the best ways to optimize TMyQuery and TMyConnections objects to return large result sets quickly? And what are the best way to optimize them to insert ,delete and update rows quickly? I haven't been able to find anything that explains how to get the best performance out of the objects in the product documentation. I am using the latest version of MyDac for Borland C++ Builder 6.

Thank you.

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 26 Oct 2006 15:29

As a rule selecting only necessary data from the server greatly increases performance. Also pay attention on FetchAll and Unidirectional modes. If FetchAll is set to False only part of the requested records will be fetched after opening. FetchAll=False mode has some restriction. Other records will be fetched on demand. If Unidirectional is set to True, FetchAll automatically becomes False. In this mode records are not cached on the client, so you can browse the record set forward only. Unidirectional mode can be useful for example for printing huge reports.
To increase performance of inserting big number of records you should pay attention on TMyLoader component. There is no way to increase performance of deletion operations by components because most of time is spent on sending data packet to the server via network and performing operation on the server.

Post Reply