Subject RE: [IBO] Volume Data Adding
Author Don Schoeman
The inefficiency is not caused by the IntToStr but maybe by the following
assignments themselves:

IBOQuery1['NAME']:=IntToStr(Random(24784729));
IBOQuery1['SURNAME']:=IntToStr(Random(24784729));
IBOQuery1['DEL_ADDR1']:=IntToStr(Random(24784729));
IBOQuery1['DEL_ADDR2']:=IntToStr(Random(24784729));

The more fields there are the more ineffecient it becomes, everytime you do
an assignment such as
IBOQuery1['NAME']:=IntToStr(Random(24784729));
then Delphi must do a lookup through the entire TStringList to find the
entry with the name 'NAME' and then replace that entry with whatever you
specified. Normally this would be ok in terms of application speed but if
you add a heck of a lot of entries I have found IBO suffers a bit. In fact a
friend of mine created a database table consisting of almost 200 fields. I
know that this is bad desine but when he tried to set the field values as
you specified, it took ages for IBO to update all the entries in the string
list. That was even before it was written to the DB!

I could be wrong but you should at least get a bit of a speed improvement if
you first clear the TStringList you wish to add the statements into and then
adding them like this:

IBOQuery1.SQL.Add('NAME=' + IntToStr(Random(24784729));
IBOQuery1.SQL.Add('SURNAME=' + IntToStr(Random(24784729));
IBOQuery1.SQL.Add('DEL_ADDR1=' + IntToStr(Random(24784729));
IBOQuery1.SQL.Add('DEL_ADDR2=' + IntToStr(Random(24784729));

Hope it helps,
Don Schoeman



-----Original Message-----
From: Gerhardus Geldenhuis [mailto:linuxmail@...]
Sent: 11 June 2001 01:54
To: IBObjects@yahoogroups.com
Subject: [IBO] Volume Data Adding


Hi
I am doing a volume and traffic test on my network and database server.
Currently I am using the ibo components as follows.

object IB_Connection1: TIB_Connection
SQLDialect = 3
Params.Strings = (
'PATH=D:\DATABASE\TOETSVOLUME.GDB'
'SERVER=SERVER'
'PROTOCOL=TCP/IP'
'USER NAME=SYSDBA'
'PASSWORD=************')
end

object IB_Transaction1: TIB_Transaction
IB_Connection = IB_Connection1
AutoCommit = True
Isolation = tiConcurrency
end

object IBOQuery1: TIBOQuery
Params = <>
Active = True
DatabaseName = 'SERVER:D:\DATABASE\TOETSVOLUME.GDB'
GeneratorLinks.Strings = (
'CUSTOMERS.CUSTNO=DIE_GENERATOR')
IB_Connection = IB_Connection1
IB_Transaction = IB_Transaction1
SQL.Strings = (
'SELECT *'
'FROM CUSTOMERS')
end

I have written a small procedure that adds a record in the following way.
IBOQuery1.Append;
IBOQuery1['NAME']:=IntToStr(Random(24784729));
IBOQuery1['SURNAME']:=IntToStr(Random(24784729));
IBOQuery1['DEL_ADDR1']:=IntToStr(Random(24784729));
IBOQuery1['DEL_ADDR2']:=IntToStr(Random(24784729));
...
IBOQuery1.Post;
I do this for all the fields.
Now I know IntToStr is not effective and also I was thinking that it does
not matter whether the characters in a name is numbers or letters as long as
it contains something.

My question is what is the most effective way to add large amount of random
data to a database with IBO? Do I use SP's or if not what components is the
best to use for speed purposes.

With my current method the program eats up memory, it grows and grows until
you stop the execution.

With the current program with 7 program running which 3 was one computer I
managed to create 119 675 records in about 7minutes. I am sure it can be
bettered. The query results is impresive with ibw i get on the following
basic query "select * from customers where name < 2000" a time of 3.275
seconds which returns 6 rows.

Groete
Gerhardus




Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/