Subject | Re: [firebird-support] Re: Firebird Usage Load Problem |
---|---|
Author | David Johnson |
Post date | 2005-07-15T01:40:07Z |
Here is a difference between mysql and firebird - and part of the
performance difference you are seeing.
mysql considers every statement to be a transaction. Other RDBMS
(including Firebird) consider an aggregate of statements bounded by an
explicit commit (or rollback) to be transaction. Anything but mysql
will allow you to roll back the transaction on an error, so they incur
both the overheads of tracking work that has not been committed and the
commit itself.
performance difference you are seeing.
mysql considers every statement to be a transaction. Other RDBMS
(including Firebird) consider an aggregate of statements bounded by an
explicit commit (or rollback) to be transaction. Anything but mysql
will allow you to roll back the transaction on an error, so they incur
both the overheads of tracking work that has not been committed and the
commit itself.
On Fri, 2005-07-15 at 01:20 +0000, Maurice Ling wrote:
> --- In firebird-support@yahoogroups.com, David Johnson
> <johnson_d@c...> wrote:
> >
> > > What I did is this (python codes):
> > >
> > > import kinterbasdb
> > > connection = kinterbasdb.connect(<connection string>)
> > > cursor = connection.cursor()
> > > # inserting data for example
> > > for line in data:
> > > cursor.execute(<sql statement>)
> > > cursor.commit()
> > >
> > > # when i'm done
> > > cursor.commit() # final commit, just in case
> > > cursor.close()
> > > connection.close()
> > >
> >
> > So you are committing after every row that you process. This will slow
> > you down enormously. Try committing every 5000 rows.
>
> That seems to help a good bit. Will be tracking on this.
>
> Thanks Maurice