On May 30, 2013, at 11:25 AM, Claudio Freire <klaussfre...@gmail.com> wrote:

> 
> That way, one could use the second form up there and benefit from
> query hashing, because session/param binding wouldn't change the hash,
> and it would be a cache hit. Has it been explored already? Or maybe
> there's something wrong on how I'm using the compiled_cache thing?
> Should I start patching? ;-)

there is a very wide gap between working with the baked query recipe, for which 
I'm not aware of all the errors you refer to so more detail would help, and 
that of patching SQLAlchemy with new features.   In particular I can't imagine 
how it would cache results, there is nothing like that in the recipe or 
compiled cache system.

If you want to work on a feature that is actually going to change SQLAlchemy, 
(and would that be before or after you finish #2720? :) ), it would be:

1. there is no bake() method, the entire thing is transparent

2. as one calls session.query(X).filter(Y).join(Z), the hashing scheme is 
working the entire time in the background against a single LRU cache, that is 
perhaps per sessionmaker(), or otherwise, to produce cached versions of the 
Query.  Everyone would get the performance gains for free in all cases.   A 
flag or other system would exist to turn the feature off for those who are 
heavily subclassing Query and having issues or other edge backwards compatible 
issues.

3. it would just be on by default in a new major release like 0.9 or 1.0

4. it would have a super crapload of very complete and clean unit tests.

Otherwise, the bake() recipe as it is can be enhanced or augmented with 
__hash__() methods and all that but I'm not aware of anything regarding it that 
would require changes to SQLAlchemy itself, since it uses a Query subclass.



-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to