Hi,
We had problems with mass deletes, deletions of 100 nodes taking 12 seconds, of which 10 seconds was content_field()'s SQL query. We have tracked down the issue to these queries:
case 'delete':
// Delete using nid rather than vid to purge all revisions.
db_query('DELETE FROM {'. $db_info['table'] .'} WHERE nid = %d', $node->nid);
return;
The query uses nid to select the rows to delete, but there is no index on nid, only on vid. By adding an index for nid in all content_field_xxx tables, we could speed up the deletion of 100 nodes to 2 seconds.
Please either create these indexes when creating the content_field_xxx tables or delete by all vids of the nid instead of directly by the nid.
Thanks,
Zoltan
Comments
Comment #1
yched commentedLet's deal with this for D6 in #287540: node_delete() performance issue: add index to nid column first.