Closed (fixed)
Project:
Category
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2006 at 05:21 UTC
Updated:
4 Jun 2009 at 09:50 UTC
I have a simple function that loops through and deletes nodes of a certain type. These nodes are custom CCK content types that also behave as categories. The content type isn't very complex... about 5 fields.
Here is my function:
function _delete_cities_submit() {
$query = "select nid from node where type='content-city'";
$results = db_query($query);
while ($node = db_fetch_object($results)) {
node_delete($node->nid);
$output .= "deleted node " . $node->nid;
}
drupal_set_message($output);
}
The problem is that this function takes about 10 minutes to delete 300 nodes!!
Comments
Comment #1
JirkaRybka commentedIMO it's entirely possible that processing hundreds of nodes is a bit slow. Normally, you would delete just single nodes, mostly, so this is quite minor, if a bug at all.
Otherwise, 4.7.x is not supported anymore, and there's 2.5 years silence, so closing now. If you've a similar problem on 6.x, I suggest using Batch API.