[sqlalchemy] Re: Precompiling O/RM queries?

2007-05-14 Thread Michael Bayer
On May 14, 2007, at 4:12 AM, Graham Stratton wrote: Hi, I'm getting some surprisingly poor performance from SQLAlchemy in .get() operations. They're typically taking about 100-200ms, though varying quite a lot. Just doing engine.execute() on the echo()ed SQL takes about 10ms. The query

[sqlalchemy] Re: Precompiling O/RM queries?

2007-05-14 Thread Graham Stratton
do you mean, the compilation of the Select object into a string ? extremely unlikely. the main speed issue with get() is that of fetching rows from DBAPI and processing into object results, which goes up by a huge margin if you have a lot of eagerly loaded instances attached to the get.

[sqlalchemy] Re: Precompiling O/RM queries?

2007-05-14 Thread Michael Bayer
On May 14, 2007, at 11:27 AM, Graham Stratton wrote: I ran a few get()s with non-existent ids (which are therefore returning no rows, confirmed by setting engine.echo to 'debug'). The average query time was about 80ms, though it varied from 56ms to 110ms. I also called engine.execute with