- ๐ฆ๐บAustralia acbramley
This popped up as part of BSI.
Is this still an issue on 11.x? If so, how many files does it take? Some steps to reproduce would be good
- ๐ฎ๐ณIndia sukr_s
The issue persists in 11.x
1. updated the steps the reproduce
2. created file_managed with 524288 and file_usage with 482306 records
3. initial page load takes upto 6 seconds and every pagination click takes about the same time. - ๐ฎ๐ณIndia sukr_s
further experimentation. Creating a index
alter table file_managed add index groupidx(fid, filename, filemime,filesize,status, created, changed);
reduces the initial load to 3 seconds and subsequent pagination to 1.5secs - Status changed to Needs review
5 months ago 4:41am 9 August 2024 - Status changed to Needs work
5 months ago 12:46pm 9 August 2024 - ๐บ๐ธUnited States smustgrave
Major bug seems like some form of test coverage will be needed
- ๐ฎ๐ณIndia sukr_s
@smustgrave: I thought about this and did not add a test case as adding a test case would take up at least 6-8 secs of test time on each run, which would increase the gitlab cost without a significant benefit. There is no logic change per se. It's a typical database admin task. Not a major issue in my perspective. So is a test coverage really needed?
- Status changed to Needs review
5 months ago 4:51am 13 August 2024 - Status changed to Needs work
4 months ago 11:26pm 14 August 2024 - ๐ฌ๐งUnited Kingdom catch
The update hook is updating the entity to whatever the schema definition is of the current code base, whereas it should use the API in https://www.drupal.org/node/2554097 โ to update just the thing it actually wants to change so that there aren't side-effects.
- ๐ง๐ทBrazil dungahk Balneรกrio Camboriรบ
For what is worth it, I've tried the index mentioned in #34 โ and it improved a lot the performance of the query.
Before the index:
51 rows in set (57.57 sec)
After the index:
51 rows in set (17.26 sec)
The index query for reference:
ALTER TABLE file_managed ADD INDEX groupidx(fid, filename, filemime, filesize, status, created, changed);
And this is the select query:
SELECT file_managed.fid AS fid, file_managed.filename AS file_managed_filename, file_managed.filemime AS file_managed_filemime, file_managed.filesize AS file_managed_filesize, file_managed.status AS file_managed_status, file_managed.created AS file_managed_created, file_managed.changed AS file_managed_changed, SUM(file_usage_file_managed.count) AS file_usage_file_managed_count, MIN(file_managed.fid) AS fid_1 FROM file_managed file_managed LEFT JOIN file_usage file_usage_file_managed ON file_managed.fid = file_usage_file_managed.fid GROUP BY file_managed.fid, file_managed_filename, file_managed_filemime, file_managed_filesize, file_managed_status, file_managed_created, file_managed_changed ORDER BY file_managed_changed DESC LIMIT 51 OFFSET 0;