[development] Database queries on drupal.org
Earl Miles
merlin at logrus.com
Wed Jul 26 15:37:07 UTC 2006
Moshe Weitzman wrote:
>> 186.896 2.967 63 pager_query SELECT DISTINCT(n.nid),
>> n.title, n.type, n.changed, n.uid, u.name, l.last_comment_timestamp AS
>> last_post, l.comment_count FROM node n INNER JOIN users u ON n.uid =
>> u.uid INNER JOIN node_comment_statistics l ON n.nid = l.nid WHERE
>> n.status = D
>
>
> the DISTINCT looks unneeded here. also, my node_comment_statistics patch
> removes a JOIN for this - http://drupal.org/node/75122. not sure who is
> issueing this query ... we should have some special case for
> pager_query() so we know who really issued it.
The DISTINCT is probably being added by node_db_rewrite_sql() which
likes to add DISTINCT to queries even when it's not rewriting them.
More information about the development
mailing list