Bad performace on TZAbstractRODataset when connected to grid
Posted: 04.12.2009, 10:02
Hi.
I'm trying to port a BDE/Firebird 2.1 app to ZEOS.
Using a TZQuery connected to a DBGrid (SMDBGrid but that doesn't matter), opening a table with about 10k records lasts too long.
In the VCL after opening the dataset, TCustomDBGrid.UpdateScrollBar is called which calls Self.VisibleRowCount -> TZAbstractRODataset.GetRecordCount -> TZAbstractRODataset.FetchRows(0) which fetches all the records in...
...well, so the performance, compared to the old BDE TQuery, is very bad. Even setting FetchRows to i.e. 100 is not optimal because then RecordCount displays only the fetched number of records and not the correct number. There is no way to get these values using the underlying Firebird API like the old BDE components did?
Michael
I'm trying to port a BDE/Firebird 2.1 app to ZEOS.
Using a TZQuery connected to a DBGrid (SMDBGrid but that doesn't matter), opening a table with about 10k records lasts too long.
In the VCL after opening the dataset, TCustomDBGrid.UpdateScrollBar is called which calls Self.VisibleRowCount -> TZAbstractRODataset.GetRecordCount -> TZAbstractRODataset.FetchRows(0) which fetches all the records in...
Code: Select all
...
if RowCount = 0 then
begin
while FetchOneRow do; // <- !!!
Result := True;
end
...
Michael