From OP, it’s not entirely clear to me if the goal is to find the total number of records or display data to the user. If it displays data, then adding all the data for 55,000 records to one row is probably not the best approach. If you are satisfied that you are executing a query in Advantage Data Architect, then it probably makes sense to use a similar approach and store the data in some kind of grid.
For example, map a TDataSource to a TDBGrid and bind the query to a data source:
AdsQuery1.Open; DataSource1.DataSet:=AdsQuery1; DBGrid1.DataSource:=DataSource1;
A data-enabled network will retrieve as much data as needed to fill the grid and will request data on request as user pages through it.
Change When you request a record counter, the entire result set must be resolved by the server. If you use the Advantage Local Server and if the data is on a network server, then reading all the data over the network will incur additional costs. If you use the Advantage Database Server (client / server version), processing will occur on the server and can be much faster.
Of course, this depends on the query, but 9 seconds to solve the result set may be too long. In Advantage Data Architect, you can check query optimization. The SQL menu has the Show Plan option, as well as a button on the SQL utility toolbar to display the query plan. Perhaps you are missing the required index.
source share