Problem/Motivation
One node type 'away' with a field with access control that is also an og group node. The same group at the moment gets referenced by all the 'away' nodes. There are ~800 nodes, and when passed to Search API Solr to check the access Solr fails with way too many booleans of the same value.
Example Solr Exception:
OR (sm_search_api_access_node:"node_access_content_access_rid:8")
OR (sm_search_api_access_node:"node_access_content_access_rid:14")
OR (sm_search_api_access_node:"node_access_nodeaccess_nodereference_view:70")
OR (sm_search_api_access_node:"node_access_nodeaccess_nodereference_view:70")
OR (sm_search_api_access_node:"node_access_nodeaccess_nodereference_view:70")
OR (sm_search_api_access_node:"node_access_nodeaccess_nodereference_view:70")
OR (sm_search_api_access_node:"node_access_nodeaccess_nodereference_view:70")
OR (sm_search_api_access_node:"node_access_nodeaccess_nodereference_view:70")
OR ....
That 70 gets ~800 times in the OR.
Proposed resolution
array_unique() on the output and don't store the large arrays in the cache table to unserialize because it won't scale.
Comments
Comment #2
joelpittetHere's a patch to show you what I propose, may look a bit much but it's mostly removing the cache_set()/cache_get() and array_unique() on the output.
Comment #3
svenryen commentedI made a different patch, addressing the issue at the root rather than changing the cached data. Here's the code. It fixes a slowness on sites that occurs after adding lots of content to the site, after which views took half a minute to render. This patch reduces view rendering time to a few seconds or even below that.
Comment #4
vegardjo commentedRunning patch from @svenryen in production, reducing page load dramatically, and no found regressions.
Comment #5
andypostbtw there's module for speed-up #1832204-5: Potential for performance improvements?