graphene-sqlalchemy
graphene-sqlalchemy copied to clipboard
Question: Is over fetching problem solved?
I am transitioning to python from C#, I know in C# the problem of over fetching data has not yet been solved. But in javascript it has been solved by Join Monster.
I have been looking at the issues here, and I see that there is a couple instances of recommendations on how to use lazy loaders to solve the N+1 problem. But I haven't seen any on how to solve the over fetching issue.
Is there a supported solution for over fetching currently or am I on my own piecing it together from other sources?
A second question is if Dataloaders is now the recommended method of solving the N+1 problem or are lazy loaders the recommended method?
It looks to me Join Monster solve a problem when you're doing basic SQL queries directly, which is not the case here since this project is based on the ORM layer of SQLAclhemy which performs and optimize the SQL queries.
Take a look at SQLAlchemy documentation http://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html
This is true, I know that the end result would be much different in this case because sqlalchemy is being used.
From my current testing, a full object is loaded and then the parser is only returning the field that that we're requested. What I am looking for from Join Monster is purely the portion of requesting the fields that need to be loaded from sqlalchemy not writing the SQL itself.
From my understanding from previous orm's is that unless you say you want only specific fields all are loaded. Which appears to be the case here.
On Jan 31, 2018 9:34 AM, "Stéphane" [email protected] wrote:
It looks to me Join Monster solve a problem when you're doing basic SQL queries directly, which is not the case here since this project is based on the ORM layer of SQLAclhemy which performs and optimize the SQL queries.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/graphql-python/graphene-sqlalchemy/issues/109#issuecomment-361949992, or mute the thread https://github.com/notifications/unsubscribe-auth/AAqXcyRVUAStfCi_yp6h27rtBR3WgFLJks5tQHnigaJpZM4R0Bri .
SQLAlchemy does have the capabilities of making individual fields lazy-loadable or not, but I don't know how easy it would be to then tell SQLAlchemy to basically prefetch fields on query, which is what it'd likely have to look like.