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

Synching participants doesn't scale on big databases #4

Open
dkns opened this issue Jan 12, 2016 · 3 comments
Open

Synching participants doesn't scale on big databases #4

dkns opened this issue Jan 12, 2016 · 3 comments

Comments

@dkns
Copy link

dkns commented Jan 12, 2016

This query:

// Add users from group synch.
$newgroupmemberssql = ' FROM {via} v
                        LEFT JOIN {groupings_groups} gg ON v.groupingid = gg.groupingid
                        LEFT JOIN {groups_members} gm ON gm.groupid = gg.groupid
                        LEFT JOIN {via_participants} vp ON vp.activityid = v.id AND vp.userid = gm.userid ';
$newgroupmemberswhere = ' WHERE v.groupingid != 0 AND vp.id is null ';
$newgroupmembers = $DB->get_recordset_sql('select distinct v.id as activityid, v.course, v.noparticipants, gm.userid
                                        '.$newgroupmemberssql.' '.$newgroupmemberswhere);

doesn't finish when executed on big tables. In our case via_participants has around ~630000 records and groups_members has around ~130000 records. If LIMIT 1 is used the query finish instantaneously however increasing LIMIT increases execution time.

Let me know if you need any more info.

@SVIeSolutions
Copy link
Collaborator

Thanks for the comment, I will look into it!!! I have many improvements that I need to do!!!

@dkns
Copy link
Author

dkns commented Jan 12, 2016

Thanks! Let me know if you need any help with it.

@SVIeSolutions
Copy link
Collaborator

We have added a new version : 2016042006. We hope that it will fix your issue. Our moodles are smaller and we have never had this issue. Please let us know if it fixes this bug.
Thank you for your patience...

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

No branches or pull requests

1 participant