Subject Re: [firebird-support] Re: When do I commit
Author Grant Brown
Hi Adam,

>>I doubt it is noticeable. They tend to be very small lists and are
>>kept in memory, so each search is at worst n complexity.

Not so sure about this, on our core product SiteDoc we first had all
querys as per you suggestion using the FieldByName etc and we then
changed them as per below and the difference in performance was just
amazing - boy did it speed things up.


var
T: Integer;
FieldArray: array[0..1] of TField;
begin

try
LoadQuery.Params[0].AsInteger := MyIDNumber;
LoadQuery.open();
FieldArray[0] := LoadQuery.FieldByName('XXXXaaaa');
FieldArray[1] := LoadQuery.FieldByName('XXXXaaaa');
while not LoadQuery.eof do
begin
MyItem_1.Text := FieldArray[0].asString;
MyItem_2.Text := FieldArray[0].asString;
LoadQuery.Next();
end;
finally
LoadQuery.Close();
end;

--
Regards,
Grant Brown

Product Development Manager
Phone : 02 4229 1185
Mobile : 0412 926 995
Email : grant@...
Web : www.sitedoc.com.au

SiteDoc - Easy to Use - Powerful Results