[sqlalchemy] Re: Slow execution of SQLAlchemy statements vs. plain text

2019-05-28 Thread Sebastian Meinhardt
Thank you for the pointers! After digging into this some more, I found that this is definitely related to something in cartain versions of SQLAlchemy. I also tried different versions of cx_Oracle (6.4.1, 7.1.2, and 7.1.3) but that had no effect on the performance of the statement. I did not

[sqlalchemy] Re: Slow execution of SQLAlchemy statements vs. plain text

2019-05-28 Thread Sebastian Meinhardt
The profiler results are in but they do not tell me anything that I did not already find by manually stepping through the code. See my first post, above. The method that takes all the time is `execute` of `cx_Oracle.Cursor` itself. I cannot step into that because that is some C-call. I did

Re: [sqlalchemy] Re: TypeDecorators don't know which database session to use

2019-05-28 Thread Jonathan Vanasco
On Tuesday, May 28, 2019 at 4:35:32 PM UTC-4, Mike Bayer wrote: > > > additionally, running SQL inside of a TypeDecorator is not the intended > usage, as well as using ORM features inside of a TypeDecorator is also not > the intended usage. > thanks, mike. I was 99.99% sure that was the

Re: [sqlalchemy] Re: TypeDecorators don't know which database session to use

2019-05-28 Thread Mike Bayer
On Tue, May 28, 2019, at 12:03 PM, Jonathan Vanasco wrote: > > > On Tuesday, May 28, 2019 at 9:10:19 AM UTC-4, Chris Wilson wrote: >> >> During initial load one can use a global session object, >> ** > > You should not do that. Global sessions are widely considered an anti-pattern.

Re: [sqlalchemy] Re: Slow execution of SQLAlchemy statements vs. plain text

2019-05-28 Thread Mike Bayer
On Tue, May 28, 2019, at 6:46 AM, Sebastian Meinhardt wrote: > The profiler results are in but they do not tell me anything that I did not > already find by manually stepping through the code. See my first post, above. > The method that takes all the time is `execute` of `cx_Oracle.Cursor`

Re: [sqlalchemy] Re: Slow execution of SQLAlchemy statements vs. plain text

2019-05-28 Thread Mike Bayer
On Tue, May 28, 2019, at 5:29 AM, Sebastian Meinhardt wrote: > Thank you for the pointers! After digging into this some more, I found that > this is definitely related to something in cartain versions of SQLAlchemy. I > also tried different versions of cx_Oracle (6.4.1, 7.1.2, and 7.1.3) but

[sqlalchemy] TypeDecorators don't know which database session to use

2019-05-28 Thread Chris Wilson
Dear Michael, I have discovered a limitation of TypeDecorators (custom column types): any one that uses the database (e.g. to load objects serialised in a custom way) has no way to know which database session to use. During initial load one can use a global session object, but expired

[sqlalchemy] Re: TypeDecorators don't know which database session to use

2019-05-28 Thread Jonathan Vanasco
On Tuesday, May 28, 2019 at 9:10:19 AM UTC-4, Chris Wilson wrote: > > During initial load one can use a global session object, > You should not do that. Global sessions are widely considered an anti-pattern. I have discovered a limitation of TypeDecorators (custom column types): > any