Creating a view with Global:PHP in the list of fields remove the Limit option of the generated query. The display of the view is correct, but the query gets all data without any limitation. This high affects views based on big data, specialy if drupal does one other query per result to fill needed values. In my case, the query executes in 10ms but needs 30s due to 5000 (all rows instead of the items_per_page) sub queries...

How to reproduce :
1. Create a new View on any node (in my case "donation")

2. Configure a full pager (in my case : 5 by 5)

3. Check the generated query :

SELECT node.title AS node_title, node.nid AS nid, node.language AS node_language, node.created AS node_created
FROM 
{node} node
WHERE (( (node.status = '1') AND (node.type IN  ('donation')) ))
ORDER BY node_created DESC
LIMIT 5 OFFSET 0

4. Add a Global:PHP field (can be empty code)

5. Check the generated query :

SELECT node.title AS node_title, node.nid AS nid, node.language AS node_language, node.created AS node_created
FROM 
{node} node
WHERE (( (node.status = '1') AND (node.type IN  ('donation')) ))
ORDER BY node_created DESC

Comments

marie_gerard created an issue.

MustangGB’s picture