If you have Drupal's PathAuto module installed (it automatically create's aliases for nodes based on a configurable range of items such as node title etc), and you run a site that has lots of "flat node alias-spaces", that is to say, for example, every user creates a page with a title of "My hobbies", except if you have 10,000 users, then you may notice the path-alias url's looking something like "/my_hobbies-1" "/my_hobbies-2" "/my_hobbies-3"
The problem with this is that Drupal will keep on SELECT'ing from your database with an incremented integer appended to the string until it finds a free (not in use) string to use. This is very slow and can lead to wierd quirky pauses in your site.
The code goes as-such..
if (_pathauto_alias_exists($alias, $src)) {
$original_alias = $alias;
for ($i = 0; _pathauto_alias_exists(drupal_substr($alias, 0, $maxlength - strlen($i)) . $separator . $i, $src); $i++) {
}
...
}
So, you might want to visit admin/settings/pathauto and ensure your path for content type "My Hobbies" is something a little broader like [author-name]/my_hobbies instead of just [title_raw]
Attached is a little hack i use to get my various site's to email if it took more than a few selects to find a good alias.
It simply emails you if it finds something that took a few tries (ie, it could be improved)
You could improve on this by getting the script to read the admin email's address from the config and send it on.
Apply with (DONT FORGET TO CHANGE THE EMAIL ADDY AFTER PATCHING!)
$ cd my-drupal-5-installation
$ wget -O - http://dgtlmoon.com/files/drupal-sub-opt-path.patch|patch -p0