Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BLOCKED] Suggested performance improvement for adding nodes to group #1677

Merged
merged 2 commits into from
Jun 26, 2018

Commits on Jun 21, 2018

  1. Suggested performance improvement for adding nodes to group

    I'm trying a way to add nodes to a group that doesn't require an explcit
    check to see if the node is already there.  There are several parts to
    this:
    1) A UNIQUE constraint needs to be added to the association table as we
    have in Django.  Something like:
    CREATE UNIQUE INDEX db_dbgroup_dbnodes_dbgroup_id_dbnode_id_key ON public.db_dbgroup_dbnodes (dbgroup_id, dbnode_id);
    2) Add the nodes one by one and flush after each one which will cause
    the IntegrityError to appear if the constraint is violated
    3) Wrap the append/flush in a nested session so that it is automatically
    rolled back in the case of a constraint violation
    4) finally after everything do the final commit (because flush just puts
    it in SQLs buffers)
    
    NOTE: Before this gets considered for a merge we have to find a way to
    put the constraint in the model.  I didn't see how to do this.
    muhrin committed Jun 21, 2018
    Configuration menu
    Copy the full SHA
    a320705 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2018

  1. Configuration menu
    Copy the full SHA
    74b8e19 View commit details
    Browse the repository at this point in the history