Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread erik
Op donderdag 12 februari 2015 16:47:10 UTC+1 schreef Michael Bayer: > > > > er...@precompiled.com wrote: > > > Hi Michael, > > > > It's a MSSQL (2012) backend. > > > > We have tried pyodbc and pymssql, using pyodbc or pymssql gives the same > results. Pyodbc uses an sp_prepexec procedure,

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread Michael Bayer
e...@precompiled.com wrote: > Hi Michael, > > It's a MSSQL (2012) backend. > > We have tried pyodbc and pymssql, using pyodbc or pymssql gives the same > results. Pyodbc uses an sp_prepexec procedure, which improves performance in > some cases, and pymssql doesn't, but in either case the par

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread erik
Hi Michael, It's a MSSQL (2012) backend. We have tried pyodbc and pymssql, using pyodbc or pymssql gives the same results. Pyodbc uses an *sp_prepexec *procedure, which improves performance in some cases, and pymssql doesn't, but in either case the parameters passed to the functions are unicod

Re: [sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread Michael Bayer
e...@precompiled.com wrote: > Hi all, > > We are struggling with bad performance in a flask/sqlalchemy app on some > databases, but not on others. > Structurally, the databases are the same, however, we have noticed that the > collation is different. > > The database that performs well uses

[sqlalchemy] Wrong collation leads to bad performance, can SQLAlchemy be forced to use non-unicode query-parameters?

2015-02-12 Thread erik
Hi all, We are struggling with bad performance in a flask/sqlalchemy app on some databases, but not on others. Structurally, the databases are the same, however, we have noticed that the collation is different. The database that performs well uses Latin1_General_CI_AI, the bad performing one u