Since you delete from apachesolr_search_nodes prior to doing the insert query no need to LEFT JOIN it in and check for NULL.

Also, node_comment_stats ALWAYS as a record for each node

comment_nodeapi()...
case 'insert':
      db_query('INSERT INTO {node_comment_statistics} (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) VALUES (%d, %d, NULL, %d, 0)', $node->nid, $node->changed, $node->uid);
      break;

This results in a severe improvement when enabling the module

Comments

Scott Reynolds’s picture

StatusFileSize
new923 bytes

...attaching patch...

pwolanin’s picture

Title: Screwy-ness on hook_enable() » apachesolr.install clean up hook_enable(), uninstall, update
StatusFileSize
new2.31 KB

Indeed - that extra condition must be a hang-over from before I added the delete code. Combining here with some other clean-up. Changing the update function since I'm finding the block is not getting saved on update.

pwolanin’s picture

Status: Needs review » Fixed

committed to 6.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.