Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Most efficient way of refreshing query


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Nov 12, 2017 11:54 AM Last Post By: Dmitry Arefiev Threads: [ Previous | Next ]
Mark Williams

Posts: 120
Registered: 5/8/10
Most efficient way of refreshing query  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2017 6:54 AM
This is not really a FireDAC specific question, but a general database question.

I am using Delphi, FireDac and mySQL. On launch of my app I am loading the contents of a large table "documents" into a query. This table can exist in many databases on many different internet servers and the size of the table could vary from probably a minimum of 5000 records to as much as 100,000 and possibly more. The table contains around 20 fields, which are mainly integer, datetime and some varchar fields, so they are not huge in size. There are no blob fields.

On app launch it is directed to one of the servers and loads the documents table from that server into a query. It loads the whole table in one hit (rather than on demand) and the query remains active in the app whilst the app is open.

The data in the documents table may change or new records may be inserted and the query needs to be refreshed every few minutes in case there are such changes.

Would I be right in saying that a call to query refresh will load the entire table once again, which would be a huge hit on the server depending on the number of users, or does it have a way of sorting the wheat from the chaff?

If it reloads the entire database, would I be better working out a way of identifying changed records and new records and loading these into a separate query and then updating the main query with this new data?
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Most efficient way of refreshing query  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 12, 2017 11:54 AM   in response to: Mark Williams in response to: Mark Williams
Would I be right in saying that a call to query refresh will load the entire table once again, which would be a huge hit on the server depending on the number of users, or does it have a way of sorting the wheat from the chaff?

Yes, entire table.

If it reloads the entire database, would I be better working out a way of identifying changed records and new records and loading these into a separate query and then updating the main query with this new data?

Yes, correct.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02