[sqlalchemy] Precompiling O/RM queries?

2007-05-14 Thread Graham Stratton
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 is not small, with a few LEFT OUTER JOINS to eagerly loaded

[sqlalchemy] retrieving columns from secondary in n:m relation

2007-05-14 Thread Glauco
Hi all, i want to retrieve columns from table used as secondary in a n:m join. For Example, in this case how to retrieda data_fine, data_inizio from secondary tables ? my mapper respect correclty this property: 'associated_unita_aziendale' : relation( UnitaAziendale,

[sqlalchemy] Re: winpdb and sqlalchemy

2007-05-14 Thread Michael Bayer
On May 13, 2007, at 11:52 PM, Eric Ongerth wrote: Incidentally, the same problem is happening when using SPE as my editor. Ordinarily it is able to open sources of imported modules so the user can view the statement where an exception occurred, but in the case of SQLAlchemy modules, it's

[sqlalchemy] Re: Calling a function (Stored Procedure) returning a recordset

2007-05-14 Thread Michael Bayer
On May 14, 2007, at 1:28 AM, Sanjay wrote: Further findings and queries on SelectResults: 1. Is SelectResults still needed in certain situations: a. Observed that SelectResults was having a count() method. If we don't use SelectResults, either we have to query the database for getting

[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: winpdb and sqlalchemy

2007-05-14 Thread Eric Ongerth
Cool. I should have realized a thorough reread of the setuptools and easy_install docs would solve this. Anyone experiencing the same problem should check the following link: http://peak.telecommunity.com/DevCenter/EasyInstall#editing-and-viewing-source-packages I reinstalled more carefully

[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

[sqlalchemy] Re: set character set in sqlalchemy?

2007-05-14 Thread Arnar Birgisson
Hi there, You can include a command in the dburi that is executed upon connection start. I use it all the time like this: mysql://user:[EMAIL PROTECTED]:3306/dbname?init_command=set%20character%20set%20utf8 Arnar On 5/14/07, Noam [EMAIL PROTECTED] wrote: Hello, I'm trying to use