Very slow speed when adding a record

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Guest

Very slow speed when adding a record

Post by Guest »

In my application I have to insert a record into a remote table. I use a TzConnection and a TzQuery in Delphi 5. After connected the TzConnection I use this code:

Code: Select all

ZQuery.SQL.Text:='SELECT * FROM table';
ZQuery.Open;
ZQuery.Insert;
ZQuery.FieldByName('id').AsInteger:=Id;
ZQuery.FieldByName('data').AsDateTime:=data;
TBlobField(ZQuery.FieldByName('image')).LoadFromStream(FS);
ZQuery.Post;
ZQuery.Close;
The FS is a tFileStream of about 6 kbytes.
The software does this operation many times and everything works fine, but the speed remain around 1 kbyte/sec.
The server and the client are connected to Internet with ADSL (I tried to upload one file in the server via FTP, the speed was around 30 kbyte/sec). On the server there's a MySQL v. 5.0.22,
the version of ZeosLib is 6.6.2-RC.

Why the speed is so low? Where I am wrong?

Thank you
Guest

Post by Guest »

Please excuse me,
but now I think that the problem is not in the Zeos Lib. I tried to do the same operations with a PHP script instead of with my software, and the result is the same. Always the speed remains around 1 kbyte/sec. Maybe the MySQL is not configured properly, or other.

Thank you.
Post Reply