Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The path 'aggregator' shows a paginated list of feed items. The query involved however is unindexed even though it would be able to use one. With low amount of items this might not be too much issue, but when there are lots, it could cause issues. Plus due to the pagination there are links on every page to visit the last page and when search bots / spiders hit all those links it could affect the site's performance.
Proposed resolution
Adding an index to the table aggregator_item on the timestamp column would allow an index to be used for the query in question.
Comments
Comment #1
nagba CreditAttribution: nagba commentedThe patch adds an index on the field 'timestamp' to the 'aggregator_item' table.
Comment #2
nagba CreditAttribution: nagba commentedhope attaching works this time
Comment #3
nagba CreditAttribution: nagba commentedmaking the patch bulletproof
Comment #5
nagba CreditAttribution: nagba commentedfixed the patch
Comment #6
nagba CreditAttribution: nagba commentedfixed up title
Comment #7
nagba CreditAttribution: nagba commentedrerolling patch for D7.18
Comment #9
pwolanin CreditAttribution: pwolanin commentedShould get the fix into D8
Comment #10
nagba CreditAttribution: nagba commentedpatch looks good. As Peter and me looked, D8 still uses the same kind of query in ItemStorageController.
Comment #11
ParisLiakos CreditAttribution: ParisLiakos commentedmakes sense
Comment #12
ParisLiakos CreditAttribution: ParisLiakos commentedah..seems that we need an update function that adds the index, according to this https://drupal.org/comment/8264991#comment-8264991
i thought we didnt, sorry
Comment #13
pwolanin CreditAttribution: pwolanin commentedoh, huh. I'd also though it was unneeded.
Guess we'll have to wrap it using a db_index_exists() check?
Comment #14
pwolanin CreditAttribution: pwolanin commentedShould be a straight port of the D7 patch then. back to RTBC (assuming tests pass).
Comment #15
alexpottCommitted abdb0c5 and pushed to 8.x. Thanks!
Comment #16
alexpottComment #17
dcam CreditAttribution: dcam commented#7 still applies locally. I'm going to retest it.
Comment #18
dcam CreditAttribution: dcam commented7: add-index-to-aggregator-item-table-d7-1790298-7.patch queued for re-testing.
Comment #19
dcam CreditAttribution: dcam commented#7 is RTBC for D7. I contains the same changes that went into D8. I tested the patch to make sure the new index is added on a clean install of D7 and when updating an existing install. The index was correctly added in both cases.
Comment #21
dcam CreditAttribution: dcam commentedAgain, it's #7 that is RTBC for D7.
Were there changes to Testbot's behavior so that it tests the last patch when the issue status is set to RTBC? I don't know why it tried to retest #14.
Comment #22
David_Rothstein CreditAttribution: David_Rothstein commentedCommitted to 7.x - thanks!