Jump to content
Sign in to follow this  
dataol

TFDQuery (Master/Detail) with CachedUpdates Too Slow on Delphi 10.4.2

Recommended Posts

After upgrading from Delphi 10.3.3 to 10.4.2, my software got really slow when I do a TFDQuery (Master / Detail) loop to edit / post records.

In Delphi 10.3.3 the performance is normal.

The same problem occurs with Firebird and MSSQLServer databases

 

Please see the attached example.

 

https://quality.embarcadero.com/browse/RSP-34302

Test.rar

Edited by dataol

Share this post


Link to post

I'm missing TFDPhysFBDriverLink and TFDGUIxWaitCursor. I don't know if it will help.

I can't try it. I have FB v3.07


Project Project1.exe raised exception class EIBNativeException with message '[FireDAC][Phys][FB]unsupported on-disk structure for file D:\DOKUMENTY\Z INTERNETU\TEST\TEST.FDB; found 11.2, support 12.2
IProvider::attachDatabase failed when loading mapping cache'.

Edited by Stano

Share this post


Link to post
1 hour ago, Stano said:

I'm missing TFDPhysFBDriverLink and TFDGUIxWaitCursor. I don't know if it will help.

I can't try it. I have FB v3.07


Project Project1.exe raised exception class EIBNativeException with message '[FireDAC][Phys][FB]unsupported on-disk structure for file D:\DOKUMENTY\Z INTERNETU\TEST\TEST.FDB; found 11.2, support 12.2
IProvider::attachDatabase failed when loading mapping cache'.

Please try it on Firebird 2.5

Share this post


Link to post

I used Firebird-2.5.9.27139-0_Win32_embed files. Insert TFDPhysFBDriverLink on the form and enter VendorLib on the given files.
He keeps reporting the same mistake to me. I do not know why.

Share this post


Link to post

Um, it's programmatic. the data was displayed in the DBGrid in about 20 seconds. But something was still going on there. I canceled it after a minute
This cycle runs relatively quickly for 6 seconds
  for I := 1 to 20 do
  begin
    qryItemReceita.Append;
    qryItemReceitaID_ITEM_RECEITA.AsInteger  := I;
    qryItemReceitaID_PRODUTO.AsInteger       := I;
    qryItemReceitaQUANTIDADE.AsFloat         := 1;
    qryItemReceitaDESCRICAO_PRODUTO.AsString := 'PRODUCT ' + I.ToString;
    qryItemReceitaPRECO.AsCurrency           := 2.00;
    qryItemReceita.Post;
  end;
Here it hangs those 20 sec
  qryItemReceita.First;
  while not qryItemReceita.Eof do
  begin
    qryItemReceita.Edit;
    qryItemReceitaVALOR_DESCONTO.AsCurrency := qryItemReceitaVALOR_DESCONTO.AsCurrency + 0.1;
    qryItemReceita.Post; //  This action takes about 3 seconds during the first cycle. At 20 cycles of 10 sec!
    qryItemReceita.Next;
  end;
Try converting both cycles to batch processing (DMArray)

Share this post


Link to post

I found a problem. It's in DBGrid. I threw away his DataSource and at the end Button1Click DBGrid1.DataSource: = dsQryItemReceita;
It goes immediately.:classic_smile:

Share this post


Link to post
37 minutes ago, Stano said:

I found a problem. It's in DBGrid. I threw away his DataSource and at the end Button1Click DBGrid1.DataSource: = dsQryItemReceita;
It goes immediately.:classic_smile:

Thanks for answering.

But I've forced this to simulate the problem.

On Delphi 10.3.3 it is too faster than 10.4.2

Share this post


Link to post

Personally, I do not use DBGrid. There are always some problems with them. I use VirtalStringTree.

Share this post


Link to post

Enclosing the loops with a qryItemReceita.DisableControls/EnableControls should help a bit.

  • Like 1

Share this post


Link to post

I knew that something like that. I just didn't find it.

Share this post


Link to post
8 hours ago, Tommi Prami said:

Please Update Ticket: https://quality.embarcadero.com/browse/RSP-34302

And/Or make new one, if you can pinpoint the exact cause of the slowdown. (If it is actually true performance regression between those Delphi versions)

 

-tee-

Ok Tommi.

I´ll do it.

 

There is a perfermance regression for sure.
Please check  the attachement on the ticket that contains a test with the same code compiled in 2 different Delphi versions. 

 

Thanks

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×