Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 296335

NodeGrantDatabaseStorage generate select with syntax error

$
0
0

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');


Viewing all articles
Browse latest Browse all 296335

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>