Hi,
I am using TXDatawebdataset component to store data got from API developed using TMS XData. I am using a TWebDBGrid to show the data collected.
I have a edit box and on text change I am filtering the XdatWebdateset locally so that it will not required to call the API again and again.
The filter works but it seems very slow. The filter is basic function and should be much faster.
I have attached the attachments showing the result. In attachment, I have typed 'indus' and it filtered the xdatasebdataset but it is very slow as you can see the start and end times that I logged.
So why the filter is slow and how to speed up the process?
try
waitMsg1.Show;
searchText := edtSearch.Text;
Condition :=' CUSTNO like ''%'+searchtext+'%'' '+
' or SHORTNAME like ''%'+searchText+'%'' '+
' or CUSTNAME like ''%'+searchText+'%'' '+
' or POSTCODE like ''%'+searchText+'%'' '+
' or POSTTOWN like ''%'+searchText+'%'' ';
Console.log(Condition);
Console.log('Filter Start: '+FormatDateTime('dd-mm-yyyy hh:nn:ss:zzz', now));
webdsCustomer.Filter := Condition;
webdsCustomer.Filtered := True;
Console.log('Filter End: '+FormatDateTime('dd-mm-yyyy hh:nn:ss:zzz', now));
finally
waitMsg1.Hide;
end;