Hi,

Just a suggestion...
I was wondering why this module still uses node_comment_statistics.
The nodetype aspects already holds latest update and creation fields, like other nodetypes use.

So why not get loose from node_comment_statistics.
- The code uses lots of resources because for every node it seems that the (node)comment code touches the table. There is a thread about this to alter the code for drupal 7, but untill now the code takes lots of resources
- Because nodecomment is NOT a comment.module, but more a nodetype drupal module, it will be good to use nodetype aspects to show latest update etc..

Thank you for considering this!

greetings,
Martijn

Comments

balabushka’s picture

I am about importing data from an old forum software and I wondered about node_comment_statistics, too...

mlncn’s picture

Project: Node Comments » Drupal core
Version: 5.x-1.1 » 6.x-dev
Component: Code » node system
Category: feature » task

We have a site that was upgraded from 5 to 6, don't know if that's why, but we do not have a node_comment_statistics table. Thing is, we wouldn't need that table if it weren't for a handful of lines in node.module's search integration:

      if ($weight = (int)variable_get('node_rank_recent', 5)) {
        // Exponential decay with half-life of 6 months, starting at last indexed node
        $ranking[] = '%d * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp)) - %d) * 6.43e-8)';
        $arguments2[] = $weight;
        $arguments2[] = (int)variable_get('node_cron_last', 0);
        $join2 .= ' LEFT JOIN {node_comment_statistics} c ON c.nid = i.sid';
        $stats_join = TRUE;
        $total += $weight;
      }

Can't figure out how this problem doesn't seem to have come up before, this dependency on a comment module table is very strange.

There's something of a core issue to get rid of it-- merging it into node module.

benjamin, agaric

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.