Bad Performance on Query.SQL.Add

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bursch
Posts: 2
Joined: Tue 25 Sep 2018 07:45

Bad Performance on Query.SQL.Add

Post by bursch » Fri 11 Jan 2019 12:01

Hi,

we have an realy huge code base with millions line of code and currently evaluating your components. Now we found an problem with very bad performance with multiple calls of SQL.Add with your query component.

It seems that every change from the sql statement results in parsing from the complete sql statement.

I know that it's possible to call SQL.BeginUpdate/SQL.EndUpdate ... I need the possibility to disable this behaviour and enable it on demand.

The ExpandMacro-method is not virtual so i have no chance to change this in my source code. It is possible to disable the parsing? Or it is possible to declare the ExpandMacro-method as virtual in your future builds?

Best regards
Manuel Bursch

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Bad Performance on Query.SQL.Add

Post by azyk » Fri 11 Jan 2019 13:39

Please compose a small test project. In it, demonstrate exactly how you use SQL.Add . In the project, include a script to create a test table. Use the contact form at our website https://www.devart.com/company/contactform.html and send us this project. Also specify the exact version of the DBMS you are using.

bursch
Posts: 2
Joined: Tue 25 Sep 2018 07:45

Re: Bad Performance on Query.SQL.Add

Post by bursch » Mon 01 Apr 2019 10:40

Hi,

on every change ofthe sql text the complete sql statement is parsed from the beginning. If you have legacy code like this:

Code: Select all

for i := 0 to 10000 do
   query.Sql.Add(INSERT .... INTO ...)
Every change get becomes slowlier. That has nothing to do with data or the dbms version. Maybe there is a simple solution to avoid this problems in your components. Is it necessary to parse the statement on every change?

MaximG
Devart Team
Posts: 1286
Joined: Mon 06 Jul 2015 11:34

Re: Bad Performance on Query.SQL.Add

Post by MaximG » Wed 03 Apr 2019 12:26

To make the generated query be parsed once, you can generate the query text and then assign the retrieved value to the query.Sql.Text property.

Post Reply