This AppleScript does for Aperture what this trick does for Mail.app: reindexes the database to improve performance.
I have posted a zipped copy of this script on the Download page at my site for convenience.
[robg adds: I haven't tested this one. Note that we've got an alternative version of the Mail reindexing tip already in the database, so there's no need to submit the above link as a new hint.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070303154647677