Re: [sqlalchemy] Performance issue with selectinload with views and PostgreSQL

2018-09-20 Thread Mike Bayer
On Thu, Sep 20, 2018 at 11:16 AM Jayson Reis wrote: > > Hi there, I guess I will try to change in the next following days. > Do you think a change like this is worth it for SQLAlchemy? big time, if you are seeing the join be the difference between 8 seconds and 100ms. at first I wasnt sure

Re: [sqlalchemy] Performance issue with selectinload with views and PostgreSQL

2018-09-20 Thread Jayson Reis
Hi there, I guess I will try to change in the next following days. Do you think a change like this is worth it for SQLAlchemy? Jayson Reis Em qui, 20 de set de 2018 às 16:31, Mike Bayer escreveu: > for guidance on how the flag is added, look at the "innerjoin=True" > flag on joinedload() /

Re: [sqlalchemy] Performance issue with selectinload with views and PostgreSQL

2018-09-20 Thread Mike Bayer
for guidance on how the flag is added, look at the "innerjoin=True" flag on joinedload() / relationship(). On Thu, Sep 20, 2018 at 10:30 AM Mike Bayer wrote: > > you would need to change the code here: > > https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/strategies.py#L1914 > >

Re: [sqlalchemy] Performance issue with selectinload with views and PostgreSQL

2018-09-20 Thread Mike Bayer
you would need to change the code here: https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/strategies.py#L1914 however, you can't just change the query to unconditionally not include the parent table, because you don't know what the "primaryjoin" is.for this to be automatic,

[sqlalchemy] Performance issue with selectinload with views and PostgreSQL

2018-09-20 Thread Jayson Reis
Hi there everyone. I would like to ask if there is a way to change how selectinload run its query. I put an example [1] that will show you sort of how my data is structured so you can have an idea, but the gist is: I have a main table (like customers) and another table (like order) which