[sqlalchemy] Re: Core API and Polymorphic Identity: a possible bug

2016-03-08 Thread adrianodiluzio
I read the docs but it never occurred to me that *both* the join objects have to be tables. Thanks! :) Leaving the correct join formula here for future references, that produces indeed the right query. SELECT employee.name, manager.manager_name > FROM employee JOIN manager ON employee.id =

Re: [sqlalchemy] Core API and Polymorphic Identity: a possible bug

2016-03-08 Thread Mike Bayer
On 03/08/2016 12:50 PM, adrianodilu...@gmail.com wrote: I've spotted the following strange behaviour while using the last version (SQLAlchemy==1.0.12) with SQLite or PostgreSQL (possibly others, too). To be short, I created a few polymorphic classes that map to their respective tables; I'm

Re: [sqlalchemy] session flush inserts performing VERY slow for MS Sql Server

2016-03-08 Thread Mike Bayer
so the profile shows pretty clearly that the time is spent on the DB side. 1006 SQL statements are clocking at .09 seconds each (!) to take a total of 93 seconds: 10060.0120.000 93.8730.093

[sqlalchemy] Core API and Polymorphic Identity: a possible bug

2016-03-08 Thread adrianodiluzio
I've spotted the following strange behaviour while using the last version (SQLAlchemy==1.0.12) with SQLite or PostgreSQL (possibly others, too). To be short, I created a few polymorphic classes that map to their respective tables; I'm unable to perform any query containing a LEFT OUTER JOIN

Re: [sqlalchemy] session flush inserts performing VERY slow for MS Sql Server

2016-03-08 Thread jbrownstein
I'm on sqla 1.0.12 / MS SQL Server 2014 / python 64bit 2.7 (sorry should have included that in the first post) Here is an extract from the profile using the code from http://docs.sqlalchemy.org/en/rel_0_8/faq.html#code-profiling I am reading explanations in the FAQ now but any guidance would be

Re: [sqlalchemy] How can I use negate for operator in UserDefinedType.Comparator

2016-03-08 Thread Mike Bayer
On 03/08/2016 04:21 AM, Frazer McLean wrote: Excellent, thanks Mike. I never knew I could do this with the expression returned by operate. (Searching the documentation for 'negate' doesn't return anything). these aren't commonly used APIs but these kinds of cases should be improved and

Re: [sqlalchemy] How can I use negate for operator in UserDefinedType.Comparator

2016-03-08 Thread Frazer McLean
Excellent, thanks Mike. I never knew I could do this with the expression returned by operate. (Searching the documentation for 'negate' doesn't return anything). On Mon, 7 Mar 2016, at 22:42, Mike Bayer wrote: > > > On 03/07/2016 01:03 PM, Frazer McLean wrote: > > Hi, > > > > This should