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.
If you look at node.module::node_feed, the first argument gets a db_query resource built from a query that just needs to retrieve nids.
Now, if you look at blog.module, functions blog_feed_user() and blog_feed_last() the queries return a lot more information (that's not required). Those queries even do join with node_revisions table, which is not needed at all. I think the join with the users table is not needed either.
These queries, I think, can be simplified, so sites where they get a lot of RSS readers, will get a significant performance save.
Comment | File | Size | Author |
---|---|---|---|
#4 | simplified_blog_feed_queries.patch | 1.74 KB | chx |
#3 | simplified_blog_feed_query.patch | 1.87 KB | edmund.kwok |
Comments
Comment #1
edmund.kwok CreditAttribution: edmund.kwok commentedStill applies to HEAD. Seems that node_feed only uses the nid and load the node. Care to submit a patch?
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedSorry, I do not have an environment at the moment to work out the patches. I changed my day job recently so I have little time now.
Comment #3
edmund.kwok CreditAttribution: edmund.kwok commentedAs suggested by markus_petrux, patch simplified queries made by blog_feed_user() and blog_feed_last(). Only selects fields that are necessary, nid and created and removed inner join with {node_revisions} and {user}.
Comment #4
chx CreditAttribution: chx commentedTrue. node_feed begins with node_load 'ing so nid is the only field that's required , but as we order on created we select that too for postgresql's sake. Rerolled for HEAD.
Comment #5
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #6
(not verified) CreditAttribution: commented