Skip to content

Fix for critical DB error with postgres backend#232

Open
mmnelemane wants to merge 1 commit intonoironetworks:masterfrom
mmnelemane:lazy_load
Open

Fix for critical DB error with postgres backend#232
mmnelemane wants to merge 1 commit intonoironetworks:masterfrom
mmnelemane:lazy_load

Conversation

@mmnelemane
Copy link
Copy Markdown

Fixes: #231

The commit updates the tree_model in migration to use lazy_load (http://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html#lazy-loading) which emits a SELECT statement instead of the Joined Eager Loading (http://docs.sqlalchemy.org/en/latest/orm/loading_relationships.html#joined-eager-loading ) which emits a LEFT OUTER JOIN by default on the SELECT statement causing the postgres backend to produce the error.

@ivar-lazzaro
Copy link
Copy Markdown

Could subquery be used instead to keep the same eager loading semantics?

@mmnelemane
Copy link
Copy Markdown
Author

@ivar-lazzaro : Thanks for this suggestion. "subquery" also seems to work fine in this case.

@mmnelemane
Copy link
Copy Markdown
Author

@ivar-lazzaro : Do you have any other suggestion. Can we merge this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants