How to delete nodes without taking a lot of time? My site has about 200 000 nodes. When I want to delete let say 200 nodes it takes about 2hr. I have also installed commerce module, views and a lot of the usual modules. What can I do to speed things up?
Usually I use 2 approach from the command line. If you call a page from the browser to accomplish the task this will use more time and resources.

1. You can create your own module named drush_delete

Inside the drush_delete.drush.inc file put this code:

&lt;?php
/**
 * @file
 * The Drush Delete drush commands.
 */

/**
* Implements hook_drush_command().
*/
function drush_delete_drush_command() {
  $items['node-delete'] = array(
    'description' =&gt; dt("Delete nodes."),
    'aliases' =&gt; array('nd'),
    'arguments' =&gt; array(
      'nids' =&gt; dt('The nids of the nodes to delete'),
    ),
    'examples' =&gt; array(
      'drush node-delete 1' =&gt; dt('Delete the node with nid = 1.'),
      'drush node-delete 1 2 3' =&gt; dt('Delete the nodes with nid = 1, 2 and 3.'),

    ),
  );
  return $items;
}

/**
 * Callback for the node-delete command
 */
function drush_drush_delete_node_delete() {
  $nids = func_get_args();
  $nids = array_filter($nids, 'is_numeric');
  $nids = array_map('intval', $nids);
  $nids = array_unique($nids);
  $nids = array_values($nids);
  $cant = count($nids);

  if ($cant &gt; 0) {
    node_delete_multiple($nids);

    drush_print(dt("Deleted nodes:"));
    drush_print(implode(' ', $nids));
  }
  else {
    drush_set_error('DRUSH_ERROR_CODE', dt("You must enter at least one nid"));
  }
}


Install the module, run drush cc drush to clear the drush cache and use the command like this:

To delete a node use:

drush node-delete 1
drush nd 1


To delete multiple nodes use:

drush node-delete 1 2 3
drush nd 1 2 3


EDIT: I just remeber that I have a collection of drush commands in github at https://github.com/adrian-cid/drush_commands.

2. You can use the Drush Entity module

Deleting node with nid 1 and 2

drush entity-delete node 1 2


Deleting all the nodes:

drush entity-delete node


Deleting all the articles nodes:

drush entity-delete node --bundles=article