*** troll.module.orig   2010-06-08 15:15:22.000000000 -0500
--- troll.module        2010-06-08 15:19:31.000000000 -0500
***************
*** 1095,1117 ****
--- 1095,1126 ----
  
    $where[] = 'u.uid <> 0';
  
+   $conFound = 0;
    if (!empty($edit['username'])) {
      $where[] = "LOWER(u.name) LIKE '%%%s%%' ";
      $args[] = drupal_strtolower($edit['username']);
+     $conFound = 1;
    }
    if (!empty($edit['mail'])) {
      $where[] = "LOWER(u.mail) LIKE '%%%s%%' ";
      $args[] = drupal_strtolower($edit['mail']);
+     $conFound = 1;
    }
    if (!empty($edit['ip_address'])) {
      $where[] = "LOWER(t.ip_address) LIKE '%%%s%%' ";
      $args[] = drupal_strtolower($edit['ip_address']);
+     $conFound = 1;
    }
    if (!empty($edit['date_created'])) {
      $where[] = "u.created > %d ";
      $args[] = strtotime($edit['date_created']);
+     $conFound = 1;
    }
  
+   if ($conFound == 0) {
+      // optimization to not kill the db when an admin first enters the troll module
+      $where[] = "u.uid=-1 ";
+   }
    $sql = "SELECT u.uid, u.name, u.mail, u.status, t.ip_address, MAX(t.accessed) AS recorded, u.created FROM {users} u LEFT JOIN {t
roll_ip_track} t ON u.uid = t.uid";
  
    $sql .= ' WHERE '. implode(' AND ', $where);