Subject Re: [ib-support] insert optimization (long)
Author Edwin Pratomo
On Wednesday 28 May 2003 02:11, Erik S. LaBianca wrote:
> Daniel, Svein
>
> Thanks for the replies. I'll try to be more clear.
>
> Since the delphi+ibx situation has a bunch of other contributing
> factors, i'll stick to the perl script i'm using for now. It DOES use
> prepared inserts. I'll include the bulk of it below.
>
> The reason i feel it is slow, is that I converted it directly from using
> MySQL. I ran the exact code below today, on the same machine, with both
> MySQL 3.23.56 and FireBird 1.5RC2 using local connections to files on
> the local filesystem. MySQL inserted 657534 records in 161 seconds (4084
> records / sec). InterBase inserted 657534 records in 294 seconds (2236
> records / sec).

Using InnoDB as the MySQL's table handler should be slower than using the
default MyISAM. When comparing to Firebird, using InnoDB seems to be more
fair due to its multi versioning concurrency control.
MyISAM is the speed demon when running in single user test environment, but I
don't think it would scale well in multi user env, yes because it uses
explicit table locking.

rgds,
Edwin.

> I'd like to bring these numbers closer to each other, if possible.
>
> --begin perl code
> #!/usr/bin/perl
> my $dbh;
> if ( 0 ) {
> $dbh = DBI->connect("DBI:mysql:postal_db", "root", "")
> or die "Couldn't connect to postal database: $DBI::errstr\n";
> }
> if ( 1 ) {
> $dbh = DBI->connect(
> "DBI:InterBase:/opt/postal.gdb",
> "SYSDBA",
> "masterkey"
> );
> }
> $dbh->{AutoCommit} = 0;