Eduardo Tavares wrote:
Hi!
I have an application with sqlconnection, sqldataset,datasetprovider
and clientdataset using Firebird and my database has 30,000 records.
It is very slow to search using CDS.locate(...);
what is the best thing to do to speed things up with this set up?
I have tried set packetrecords to 300 something like that but did not
help.
what is the best approach for this scenario?
You have to rethink your approach. What you are currently doing
basically loads the whole database table into client memory. That works
for small, single-user databases, but not for multiuser databases using
an advanced database engine, with support for transactions and
concurrent access from different users, and potentially millons of
records in multiple tables.
The equivalent of using something like locate is to formulate a SQL
SELECT statement that returns only the records fitting your search
criteria. To make SELECT performant even for large numbers of records
in the table(s) you need to define indices on the table for the columns
you typically use for searching. SQL also allows you to formulate
queries that collect data from several database tables and return it as
if it came from a single table. Such result sets are usually read-only,
though.
--
Peter Below
TeamB
Connect with Us