Problem with ZQuery filter
Posted: 18.10.2006, 11:22
hello,
Here's a table named "historique" on a mySQL database with 271067 records. My query is a simple "select * from historique" called by a TZQuery instance named ZHistorique. It fills a TDataSource object named dsHistorique which is use as a datasource for a TDBGrid.
Then I try to filter my record on client side like this :
ZHistorique.Filter := 'client = ' + strClient;
ZHistorique.Filtered := true;
"Client" field is an integer, non null, non-unique and considered as an index on both side (declared in IndexFieldNames on client side). I used filters this way on other tables with less records and it works fast and well, but for this one, filtering is very slow (several minutes). I noticed that if the TDataSource is not declared as datasource for the TDBGrid, first attempt of filtering is fast enough (few seconds), but on new one, affectation on Filter property lasts too long again.
Is my table too voluminous for that use ?
zeosdbo 6.1.5-stable, unpatched, with Delphi 7.
Waiting for your help, thank you.
Here's a table named "historique" on a mySQL database with 271067 records. My query is a simple "select * from historique" called by a TZQuery instance named ZHistorique. It fills a TDataSource object named dsHistorique which is use as a datasource for a TDBGrid.
Then I try to filter my record on client side like this :
ZHistorique.Filter := 'client = ' + strClient;
ZHistorique.Filtered := true;
"Client" field is an integer, non null, non-unique and considered as an index on both side (declared in IndexFieldNames on client side). I used filters this way on other tables with less records and it works fast and well, but for this one, filtering is very slow (several minutes). I noticed that if the TDataSource is not declared as datasource for the TDBGrid, first attempt of filtering is fast enough (few seconds), but on new one, affectation on Filter property lasts too long again.
Is my table too voluminous for that use ?
zeosdbo 6.1.5-stable, unpatched, with Delphi 7.
Waiting for your help, thank you.