?
avatar boddunan
boddunan
11 Feb 2021

Steps to reproduce the issue

Access any article on the site

Expected result

The page loads without adding heavy load on the database

Actual result

Almost all rows related to articles in the assets table are being fetched. Following the query logged by mysql slowquery.

# Time: 2021-02-11T18:22:27.975760Z
# User@Host: @ localhost []  Id:    53
# Query_time: 51.411838  Lock_time: 0.001211 Rows_sent: 10978  Rows_examined: 11010
SET timestamp=1613067696;
SELECT `id`,`name`,`rules`,`parent_id`
FROM `jos_assets`
WHERE `name` LIKE 'com_content.%' OR `name` = 'com_content' OR `parent_id` = 0;

This query is being logged from preloadPermissions method in the file libraries/src/Access/Access.php

System information (as much as possible)

Ubuntu 20.04, Joomla 3.9.24, PHP 7.4

Additional comments

avatar boddunan boddunan - open - 11 Feb 2021
avatar joomla-cms-bot joomla-cms-bot - change - 11 Feb 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Feb 2021
avatar chmst
chmst - comment - 13 Feb 2021

Related? #28132


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32388.

avatar boddunan
boddunan - comment - 14 Feb 2021

Related but not the same. I am more concerned about why all the rows needs to be fetched from assets table than the query performance. You may add full text index or another index but the fact remains - it fetches all records in assets table. If you see my query, it fetched 10k records for showing any article which is overkill for a CMS plaform that serve thousands of pages.

avatar rdeutz rdeutz - change - 9 Mar 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-03-09 21:02:12
Closed_By rdeutz
avatar rdeutz rdeutz - close - 9 Mar 2021
avatar rdeutz
rdeutz - comment - 9 Mar 2021

Closing because it's a dublicate of #28132, it's the same problem that we fetch all rows and an index will not help for like queries

Add a Comment

Login with GitHub to post a comment