slow execution of the TUniTable Last / Ctrl-End command
Posted: Wed 11 May 2022 09:25
Hi,
I have table: 95 fields (71 digital / 13 text / 10 date / 1 memo) 107500 records
when opening (Devexpress grid) the time is up to 0.1 seconds
with the Last / Ctrl-End command for more than 260 seconds
Delphi XE2 - UniDAC.842 - SQL Anywhere 11
code
procedure TfrmTest.btnUniDac2Click (Sender: TObject);
begin
FStartTime: = now;
btnUniDac2.Enabled: = false;
cxGridDBTableView1.DataController.DataSource: = nil;
cxGridDBTableView1.ClearItems;
cxGridDBTableView1.DataController.DataSource: = dsUniDac;
cxGridDBTableView1.BeginUpdate;
dsUniDac.DataSet: = tblUniDac;
tblUniDac.Connection: = FDBDev.GetConnection;
tblUniDac.DisableControls;
tblUniDac.TableName: = 'BillingItems';
tblUniDac.KeyFields: = 'BillingItemID';
tblUniDac.ReadOnly: = true;
tblUniDac.Options.FlatBuffers: = true;
tblUniDac.SpecificOptions.Values ['FetchAll']: = 'false';
tblUniDac.Open;
cxGridDBTableView1.DataController.CreateAllItems (true);
tblUniDac.EnableControls;
cxGridDBTableView1.EndUpdate;
btnUniDac2.Enabled: = true;
Label1.Caption: = FloatToStr (MilliSecondsBetween (Now, FStartTime) / 1000);
end;
procedure TfrmTest.btncEnd2Click (Sender: TObject);
begin
FStartTime: = now;
btncEnd2.Enabled: = false;
tblUniDac.DisableControls;
tblUniDac.Last;
tblUniDac.EnableControls;
btncEnd2.Enabled: = true;
Label2.Caption: = FloatToStr (MilliSecondsBetween (Now, FStartTime) / 1000);
end;
I have table: 95 fields (71 digital / 13 text / 10 date / 1 memo) 107500 records
when opening (Devexpress grid) the time is up to 0.1 seconds
with the Last / Ctrl-End command for more than 260 seconds
Delphi XE2 - UniDAC.842 - SQL Anywhere 11
code
procedure TfrmTest.btnUniDac2Click (Sender: TObject);
begin
FStartTime: = now;
btnUniDac2.Enabled: = false;
cxGridDBTableView1.DataController.DataSource: = nil;
cxGridDBTableView1.ClearItems;
cxGridDBTableView1.DataController.DataSource: = dsUniDac;
cxGridDBTableView1.BeginUpdate;
dsUniDac.DataSet: = tblUniDac;
tblUniDac.Connection: = FDBDev.GetConnection;
tblUniDac.DisableControls;
tblUniDac.TableName: = 'BillingItems';
tblUniDac.KeyFields: = 'BillingItemID';
tblUniDac.ReadOnly: = true;
tblUniDac.Options.FlatBuffers: = true;
tblUniDac.SpecificOptions.Values ['FetchAll']: = 'false';
tblUniDac.Open;
cxGridDBTableView1.DataController.CreateAllItems (true);
tblUniDac.EnableControls;
cxGridDBTableView1.EndUpdate;
btnUniDac2.Enabled: = true;
Label1.Caption: = FloatToStr (MilliSecondsBetween (Now, FStartTime) / 1000);
end;
procedure TfrmTest.btncEnd2Click (Sender: TObject);
begin
FStartTime: = now;
btncEnd2.Enabled: = false;
tblUniDac.DisableControls;
tblUniDac.Last;
tblUniDac.EnableControls;
btncEnd2.Enabled: = true;
Label2.Caption: = FloatToStr (MilliSecondsBetween (Now, FStartTime) / 1000);
end;