Problem/Motivation
Performance issue during using grands system.
Steps to reproduce
Use grands with a lot numbers of node and users + 3000
Code $query = $this->database->select('node_access'); without alias param
generate db query like this: with 2x node_access
SELECT 1 AS "expression"
FROM
"node_access""node_access"
WHERE ("grant_view">= '1') ...
sql can handle it, but the query lengthens very much and makes a lock on the table if we have a large number of users.
Proposed resolution
class NodeGrantDatabaseStorage
line 81
$query = $this->database->select('node_access');
and
line 132
$query = $this->database->select('node_access');
replace on
$query = $this->database->select('node_access', 'na');