Closed (duplicate)
Project:
Group
Version:
8.x-1.0-beta4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2016 at 18:25 UTC
Updated:
4 Feb 2022 at 09:41 UTC
Jump to comment: Most recent
I have a site in development but containing 250 groups (all of one group type) and 6000 nodes as content. Adding new content is *really* slow - taking about 10 seconds from clicking save to seeing the "second" form and another 10 seconds from clicking save on that to seeing a result.
I'm worried if this is going to get worse as content increases?
Tested on both core 8.1.10 and 8.2.0
Comments
Comment #2
zerolab commentedPossibly related to #2796197: Group or Group Node generates some massive queries.
Also #2718387: Performance hit with large number of groups springs to mind
Comment #3
rachel_norfolkWith the second issue, zerolab, is there something I can check to see if it is implemented in my db? TBH the issue just seems to roll off to closed without a specific patch or conclusion as far as I can see?
Comment #4
zerolab commentedFor the second issue it was adding a temporary
return;at the top ofgnode_node_grants()I lost track of the changes that led to the issue being closed, but we also did not need gnode.
I am sure Kristiaan has plenty of insight on that
Comment #5
rachel_norfolkYes, but that temporary
return;kind of assumed that the user adding content was uid=1 didn't it? Kind of defeats the point of the module, surely? I'm feeling more than a bit worried right now if I've made a bad decision. :-/Comment #6
rachel_norfolkRight then - there are acknowledged issues reading the many possible node grants across many possible groups during the rendering of views. I get that.
It strikes me that we *shouldn't* need to run any of those during the creation of *new* group content, though. Surely, the only query that needs to run is the one that says "does this user/role have the ability to add this type of content to *this* group. That should not be creating lots (and I do mean lots - tens of thousands) of queries.
Are we simply querying things that are not needed?
With a little guidance, I can easily justify the work time to look at this - but do need guidance!
Comment #7
kristiaanvandeneyndeAs we discussed on IRC I'm pretty sure it's related to #2796197: Group or Group Node generates some massive queries but please verify by disabling that system, clearing caches and then trying again.
You're looking to disable gnode_node_grants() mainly by making it return an empty array.
Comment #8
rachel_norfolkYes - was good to catch up on IRC and see a way to move this on.
I've tried the patch described above and , for the admin user 1, yes it does dramatically speed up adding new nodes. Basically instant.
So, it strikes me that we need to understand the minimum "query effort" required for each operation against a group. Presumably, that list of operations is something like:
- Create a group entity
- Retrieve a group entity
- Update a Group entity
- Delete a Group entity
- Create a gnode* related to a group
- Retrive a gnode (directly or as part of a view)
- Update a gnode "
- Delete a gnode "
- Create a user relation
- Retrive a user relation
- Update a user relation
- Delete a user relation
I assume that's the list?
*presuming gnode covers same scenarios of other entities
Comment #9
kristiaanvandeneyndeIt's weird that adding a new node would start gathering the user's grants. But then again there may be a reason why it's doing that so I am not going to comment on that as if it were a bug in core.
Perhaps we should further discuss this in #2796197: Group or Group Node generates some massive queries now? Seeing as how you've confirmed that this is the cause of your problem.
I'll add you and zerolab to the credits there.
Comment #10
mwebaze commentedI am experiencing this very issue. Adding a new announcement to the group takes way too long. I discovered that SqlContentEntityStorage:save() is called multiple times in Group::addContent. I am currently running Drupal 9.3.3. The grants issue previously discussed doesn't seem to affect me.