[sqlalchemy] `func.similarity` performance

2016-03-30 Thread Robert Smith
I'm using sqlalchemy 1.0.12 with postgreSQL 9.4.6 with the pg_trgm extension enabled. Basically, I'm performing a similarity-based query on a single column: In [26]: str(session.query(Model).order_by(desc(func.similarity(Model.description, 'string'))).limit(100)) Out[26]: 'SELECT model.id AS

Re: [sqlalchemy] relationships, potentially large collections and eagerloading/bad dbs.

2016-03-30 Thread Jonathan Vanasco
Thanks a ton. This was really quick to implement and solved a bunch of issues! -- 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

Re: [sqlalchemy] scoped_session, sessions and thread safety

2016-03-30 Thread Mike Bayer
On 03/30/2016 12:37 PM, Mehdi GMIRA wrote: I've read a lot of stuff on scoped_session, thread safety, and sessions, and i just don't get it. For me, a session is just a "wrapper" around the actual database behind it. And databases do not like concurrent updates of the same row within multiple

[sqlalchemy] scoped_session, sessions and thread safety

2016-03-30 Thread Mehdi GMIRA
I've read a lot of stuff on scoped_session, thread safety, and sessions, and i just don't get it. For me, a session is just a "wrapper" around the actual database behind it. And databases do not like concurrent updates of the same row within multiple transactions. So, it is my understanding

Re: [sqlalchemy] relationships, potentially large collections and eagerloading/bad dbs.

2016-03-30 Thread Mike Bayer
On 03/30/2016 11:56 AM, Jonathan Vanasco wrote: On Wednesday, March 30, 2016 at 12:46:01 AM UTC-4, Mike Bayer wrote: why can't you build a relationship() which has its primaryjoin set up to do this? You can do it w/ a correlated subquery. Can you reference an example ? from

Re: [sqlalchemy] relationships, potentially large collections and eagerloading/bad dbs.

2016-03-30 Thread Jonathan Vanasco
On Wednesday, March 30, 2016 at 12:46:01 AM UTC-4, Mike Bayer wrote: why can't you build a relationship() which has its primaryjoin set up to > do this? You can do it w/ a correlated subquery. > Can you reference an example ? > That is, unless you want this relationship() to load