On Tue, Mar 23, 2010 at 7:50 AM, Juan Manuel Santos <vicariou...@gmail.com> wrote: > Sorry, missed that detail. In all cases I used SQLite, with pysqlite at > version 2.5.6. > Python is version 2.6.4
Without actual source snippets to look at it's hard to say anything for certain but: Inserting records one at a time into any of the SQL databases is very slow. SQLObject always creates objects immediately and so creating lots of objects can be relatively slow. In SQLAlchemy there are ways to batch create objects. Once can use SQLObject's query builder to create mass inserts [1]. It's not extensively well documented and you'll have to be careful with how manual inserts interact with SQLObject's object cache. If you set object attributes one by one, SQLObject sends an update query each time you update an attribute. You can gain more control over when updates happen using lazy updates [2]. SQLite is by default quite aggressive about syncing changes to disk. You can (temporarily) chose speed over data integrity using the synchronous SQLite pragma [3]. Finally, if you set a SQLObject connection to debug [4] it will print out all the SQL queries made allowing you to debug these sorts of performance issues. Generally speaking, fewer queries means better performance. :) [1] http://www.sqlobject.org/SQLBuilder.html [2] http://www.sqlobject.org/SQLObject.html#lazy-updates [3] http://www.sqlite.org/pragma.html [4] http://www.sqlobject.org/SQLObject.html#declaring-a-connection ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss