Hello,

I'm using SQLAlchemy 0.8.4 with PostgreSQL 9.3.  I have a situation where I 
need to run the same set of queries millions of times in one session.  I 
think it would be very helpful from a performance perspective if I could 
prepare my query ahead of time.  (The data under the queries is not 
changing significantly during a run.)

Is this possible?  Is SQLAlchemy already doing it behind the scenes for me 
magically?

I was imagining/hoping I'd find something like this:

   # prepare the query:
   myPreparedQuery = mySession.query(stuff).filter(parameter 
definitions).prepare()

   # run the query whenever I need it during my session:
   myPreparedQuery.parameters(stuff).fetchall()

Unfortunately query.prepare() appears to be for 2-phase commits, which I 
don't think are the same thing as a prepared statement...

I have not found much documentation, nor even many discussion threads on 
the topic, and what I have found have not been clear.  I apologize if I 
missed something somewhere and this is old-hat-FAQ material.

Suggestions?



-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to