Re: Best Coding Practices

Rich Shepard <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 25 Oct 2006, Gerhard Häring wrote:

> You should commit whenever you reached a consistent state of your data -
> this rule is obviously only relevant when there are different entities in
> your database (different tables).

Gerhard,

   We do have about a dozen tables in the database.

> Doing COMMITs when they're not really necessary will decrease performance
> as each COMMIT implies a sync operation of the OS, so you're waiting on
> buffers being flushed to disk here. This is important if you're doing mass
> operations with loads of data. The usual procedure here is to commit after
> every few hundred or thousand records that you insert during bulk loads.

   For the most part, the application is user-I/O bound. There is a very
large amount of data to be entered for each model, and it's not a bulk
insert but item-by-item. So issuing a COMMIT in our situation will keep the
memory buffers flushed to disk. The actual run of a model is only a minute
or two (for most situations), and the only table being written to is the
log.

Many thanks for the insight,

Rich

- -- 
Richard B. Shepard, Ph.D.               |    The Environmental Permitting
Applied Ecosystem Services, Inc.(TM)    |            Accelerator
<http://www.appl-ecosys.com>     Voice: 503-667-4517      Fax: 503-667-8863
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFP74XugEIjC001L0RAjTBAJ4nEmwfPi1jY7NqVwRjWPPFhWS/+ACdGYkX
J/+539M5+J3JC+g2n1J+drw=
=Tz6Y
-----END PGP SIGNATURE-----

_______________________________________________
pysqlite mailing list
pysqlite-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/pysqlite
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.