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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

edmund.kwok’s picture

Still applies to HEAD. Seems that node_feed only uses the nid and load the node. Care to submit a patch?

markus_petrux’s picture

Sorry, 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.

edmund.kwok’s picture

Status: Active » Needs review
FileSize
1.87 KB

As 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}.

chx’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
1.74 KB

True. 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.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)