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
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | install-cleanup-459930-2.patch | 2.31 KB | pwolanin |
| #1 | enable.patch | 923 bytes | Scott Reynolds |
Comments
Comment #1
Scott Reynolds commented...attaching patch...
Comment #2
pwolanin commentedIndeed - 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.
Comment #3
pwolanin commentedcommitted to 6.x