Hi, I've made this post already on my blog but it was suggested i post here as it might be an interesting point of discussion.
The first scenario is a single table with 24,000 rows. The problem is that using SQLAlchemy through Elixir to map this table to an object, and performing a fairly naive MappedThing.query().all() the process takes roughly 4.8 seconds to return every item! Compared to 0.3 seconds total time taken to get and store every row in a tuple using MysqlDb and a cursor. Furthermore, when i attempt to use the object as i'd actually want in practise, i.e. join the values of this 24,000 row table to appropriate other tables as defined by the database's foreign keys, the whole process takes a really long time, running a very inefficient join query taking roughly 10 seconds to complete. Again this is compared to a set of queries taking under 1 second in pure SQL The scenario where i'd want such a query where i get all the data is primarily administrative and subsequently arguably it doesn't matter if its slow. However similarly unusable speeds are found even when running slightly cut down versions for users. My solution at the moment is to simply use SQLAlchemy as a glorified MysqlDb connection with a very fancy SQL statement generation library. I'd like to use the ORM sides more but with these speeds i'm not sure i can! The question is, is SQLAlchemy supposed to be this slow? Is this the cost of wanting your data as objects? Has anyone else got experience with SQLAlchemy working with larger databases and if so how does it fair on such queries? Are they just avoided entirely.... or am i just approaching this problem from the wrong direction, in which case any advice would be much appreciated! Thanks The specific code and setup i have can be found here: http://www.sinjax.net/wordpress/?p=1652 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---