0

I'm coming here because I've exhausted my knowledge and search skills.

I have a very simple application with Delphi XE2 and Firedac (Version 8.0.3) which uses TADQuery to insert a registry in a table that contains 800k rows (10 columns), primary key is bigInteger incremental.

The first insert runs very slow and the subsequent inserts are almost instantaneous until i restart the application, after restarting the application the first Insert runs very slow again.

I tried to run the same statement in IBExpert, all statements are instantaneous.

So, must be something in the component right ?

I'm using TADConnection + TADQuery to run all statements.

Some properties maybe in the TADConnection or TADQuery maybe ?

Any help will be welcome

Ken White
  • 123,280
  • 14
  • 225
  • 444
Rebelss
  • 364
  • 1
  • 5
  • 15
  • Too many possible reasons without seeing any code on how you're actually doing the insert. Just off the top of my head, I see two possible reasons: 1) Opening the entire table, thus fetching all records, prior to the insert, or 2) Network issues (such as DNS) which causes a delay in the time it takes to find/connect to the database server. Have you tried stepping through your code in debug to see precisely where this delay happens? – Jerry Dodge Jan 18 '17 at 21:27
  • Also, there's no such thing as `TADConnection` or `TADQuery`. Do you mean `TFDConnection` and `TFDQuery`? – Jerry Dodge Jan 18 '17 at 21:31
  • @JerryDodge, early FireDAC versions still used the TAD-naming as in AnyDAC. – Uwe Raabe Jan 18 '17 at 21:35
  • @UweRaabe Hmm interesting, I just went through 2 pages of Google searching for `TADQuery` and only mentions of `TADOQuery`. – Jerry Dodge Jan 18 '17 at 21:36
  • @JerryDodge, see http://www.da-soft.com/anydac/ – Uwe Raabe Jan 18 '17 at 21:39
  • Is the Query prepared before the first run? If not try to call TadQuery.prepare after setting the params the first time – Fritzw Jan 19 '17 at 13:13

0 Answers0