Re: [sqlalchemy] Query.delete() doesn't condition on polymorphic type

2016-09-12 Thread Mike Bayer
On 09/12/2016 06:18 PM, 'Thomas Gillam' via sqlalchemy wrote: Thanks very much for the quick reply! Perhaps I’m missing something, but in this example there is only one table (‘Bird’). The derived class doesn’t have a join table, it only differs in its polymorphic identity. Does your

Re: [sqlalchemy] Query.delete() doesn't condition on polymorphic type

2016-09-12 Thread 'Thomas Gillam' via sqlalchemy
Thanks very much for the quick reply! Perhaps I’m missing something, but in this example there is only one table (‘Bird’). The derived class doesn’t have a join table, it only differs in its polymorphic identity. Does your reasoning still apply in this case? Thanks, Tom > On 12 Sep 2016, at

Re: [sqlalchemy] Query.delete() doesn't condition on polymorphic type

2016-09-12 Thread Mike Bayer
On 09/12/2016 05:30 PM, 'Thomas Gillam' via sqlalchemy wrote: Hello all, I ran into a problem today when running delete() on a query created on a derived polymorphic class. In a nutshell, the SQL produced from the batch delete didn't condition on the polymorphic type, resulting in much

Re: [sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Thierry Florac
I don't think it's so easy to produce a test case... Generaly speaking, indexes are used in a normal way! There's only in a single case, for a single table, that they are not used even for common operations. Maybe it's a statistics problem or something else I don't understand; and AFAIK the

[sqlalchemy] Query.delete() doesn't condition on polymorphic type

2016-09-12 Thread 'Thomas Gillam' via sqlalchemy
Hello all, I ran into a problem today when running delete() on a query created on a derived polymorphic class. In a nutshell, the SQL produced from the batch delete didn't condition on the polymorphic type, resulting in much broader deletion than was intended. I'm running SQLAlchemy 1.0.9.

Re: [sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Mike Bayer
I'd try to see on the cx_oracle list if you can produce a self-contained cx_Oracle-only test case and illustrate that indexes are not being used...I think this comes up a lot over there it's like an OCI thing. On 09/12/2016 03:20 PM, Thierry Florac wrote: Hi Mike, I really agrea with you

Re: [sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Thierry Florac
Hi Mike, I really agrea with you on all the points you mentionned. And I won't add anything about the cost of an Oracle database license and administrators compared with their performances! But I actually don't have the choice... :-/ My problem is clearly a database problem at first! But as my

[sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Thierry Florac
Hi, I'm working with an Oracle database which, for a reason I can't understand, doesn't want to use indexes when working on a given table (which is quite large) with prepared statements! I know I can use literal columns when running "select" queries (using the "literal_column" function), so that