Efficient Logging of data
Posted: Mon 18 Jun 2012 08:58
I need to log data to a table every half a second. I would like to do this in the most efficient way. So far i have come up with:
Is there a better way? Ideally i would like to buffer this data and then do a bulk insert, however i cannot lose any of this - so committing first is the only option.
If I avoid the opening and closing of the Query, will the AppendRecord() method store the data in the query object (i.e. keep using memory)?
Code: Select all
Q1.Close;
Q1.SQL.Clear;
Q1.SQL.Add('SELECT * FROM `MyTable` WHERE 0 = 1');
Q1.Open;
Q1.AppendRecord(VarArrayOf([my data....]));If I avoid the opening and closing of the Query, will the AppendRecord() method store the data in the query object (i.e. keep using memory)?