devart driver runs an extra child query

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
costa
Posts: 30
Joined: Thu 27 Aug 2009 20:30

devart driver runs an extra child query

Post by costa » Mon 21 Apr 2014 22:45

Hello:

To test reproduce this issue please use this project: https://dl.dropboxusercontent.com/u/353 ... lity01.zip. I used XE5 and the latest version of the devart dbexpress driver for oracle (6.3.6).

These are the steps:

1. Open the project in XE5. Modify the connection properties to point to your own oracle database. The queries don't need any table and they create rows on the fly. You may also have to reconfigure the location of the sql monitor trace file.
2. Open dbmonitor (the tool from your site that comes with the driver).
3. Run the project.
4. Go to the dbmonitor window. There is an extra query to retrieve child records. See the screenshot below and the selected query. The parameter value is 0 which is the value that was set at design time. This query is redundant. If you change the driver to the dbexpress Oracle driver you'll notice that no such query is executed (check the c:\temp\dbexpress_log.txt file, that is the sql monitor trace file). The next query retrieves the child data associated with the first row (parent id=1).

When you have lots of child datasets the driver will execute a dummy query for each child dataset which can affect the performance of the application.

Image

What can be done to get rid of this redundant query?

One more thing to add, the query for the child dataset in this sample project is contrived, in the real app it has the pattern: select * from some_view where parent_id = :ID.

Thanks

Post Reply