Page 1 of 1

Bad Performance on Query.SQL.Add

Posted: Fri 11 Jan 2019 12:01
by bursch
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

Re: Bad Performance on Query.SQL.Add

Posted: Fri 11 Jan 2019 13:39
by azyk
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.

Re: Bad Performance on Query.SQL.Add

Posted: Mon 01 Apr 2019 10:40
by bursch
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?

Re: Bad Performance on Query.SQL.Add

Posted: Wed 03 Apr 2019 12:26
by MaximG
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.