[sqlalchemy] Re: `func.similarity` performance

2016-04-01 Thread Jonathan Vanasco
if you can put together a self-contained repeatable example that triggers this, i'd be happy to take a look. -- 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] Re: `func.similarity` performance

2016-04-01 Thread Robert Smith
Jonathan and Sergey: I tried to use the `op()` method but for some reason it fails in this particular query (session.query(Model).filter(Model.description.op('%')('string'))). I get the following error: /home/user/anaconda/envs/gensim/lib/python3.5/site-packages/sqlalchemy/engine/default.py

[sqlalchemy] Re: `func.similarity` performance

2016-03-31 Thread Sergey V.
Robert, my understanding is that SQLAlchemy knows nothing about the Postgres's `similarity` function - sqlalchemy.func just magically generates the SQL output depending on which member you invoke. Try `func.magic_unicorns()`. So, there's not much to optimize here - it outputs what you give it.