Re: [sqlalchemy] Baked queries vs before_execute hook

2017-10-12 Thread Martijn van Oosterhout
On Thursday, October 12, 2017 at 5:47:53 PM UTC+2, Mike Bayer wrote: > > > It sounds like you are getting back inconsistent SQL for the same > query based on some external context that is not being considered as > part of the cache key. This would indicate that you are probably > modifying the

Re: [sqlalchemy] Baked queries vs before_execute hook

2017-10-12 Thread Mike Bayer
On Thu, Oct 12, 2017 at 10:54 AM, Martijn van Oosterhout wrote: > Hi, > > Recently we've been looking into the baked query feature as a method of > speeding up query compilation. We also use a before_execute hook to modify > the query before execution to handle permission

[sqlalchemy] Baked queries vs before_execute hook

2017-10-12 Thread Martijn van Oosterhout
Hi, Recently we've been looking into the baked query feature as a method of speeding up query compilation. We also use a before_execute hook to modify the query before execution to handle permission related stuff. One thing that turned up was that when using a baked query that it cached the

Re: [sqlalchemy] OpenStack Glance upgrade script breaks with SQLAlchemy 1.1.11 but not 1.0.12

2017-10-12 Thread Byron Yi
Thanks Mike. Glad to know it’s been fixed. Best, Bairen > On 12 Oct 2017, at 21:54, Mike Bayer wrote: > > Your migrate is out of date. this was fixed one year ago: > > https://github.com/openstack/sqlalchemy-migrate/commit/e9175a37ce0b0b0e87ad728c8a6a10bed100065b >

Re: [sqlalchemy] OpenStack Glance upgrade script breaks with SQLAlchemy 1.1.11 but not 1.0.12

2017-10-12 Thread Mike Bayer
Your migrate is out of date. this was fixed one year ago: https://github.com/openstack/sqlalchemy-migrate/commit/e9175a37ce0b0b0e87ad728c8a6a10bed100065b On Thu, Oct 12, 2017 at 9:51 AM, Mike Bayer wrote: > On Thu, Oct 12, 2017 at 8:32 AM, Byron Yi

Re: [sqlalchemy] OpenStack Glance upgrade script breaks with SQLAlchemy 1.1.11 but not 1.0.12

2017-10-12 Thread Mike Bayer
On Thu, Oct 12, 2017 at 8:32 AM, Byron Yi wrote: > It appears that autoincrement=True is set by default for primary key when > upgrading from 1.0 to 1.1, no matter if it is integer (which is not in > glance; they use VARCHAR(36)). > > See

Re: [sqlalchemy] How do Insert statements for single-table inheritance tables get batched together?

2017-10-12 Thread Mike Bayer
I'm actually happy with those results. execute_batch is just a drop-in, while execute_values is more complicated since we have to intercept specific kinds of statements (INSERTS that have exactly one VALUES clause invoked against multiple parameter sets), and still may be more error prone. a 7%

[sqlalchemy] OpenStack Glance upgrade script breaks with SQLAlchemy 1.1.11 but not 1.0.12

2017-10-12 Thread Byron Yi
It appears that autoincrement=True is set by default for primary key when upgrading from 1.0 to 1.1, no matter if it is integer (which is not in glance; they use VARCHAR(36)). See https://bugs.launchpad.net/glance/+bug/1723097 -- SQLAlchemy - The Python SQL Toolkit and Object Relational