Well I restarted AOLserver (it was at 718mb) and vacuumed the database. it didn't help. Main issue is the existing code runs the search query twice, one to search and once to count the results.
We need to write a "best guess" result estimator, sort of how Google gives results. Its faster, but still not efficient to do the count seperately on Oracle.
Heh, this is interesting. I recently had the opportunity to hear Tom Kyte (from asktom.oracle.com) talk about this. He demonstrated how Google completely guesses the number of results in a search (and also how it slows pretty badly after the first 5 or so pages). He said to never give an exact count, just make a guess using cardinality from v$sql_plan. Or if you're using Intermedia it can give you a guess. He also said never to give a link to a "Last Page" - just give the user an option to sort the query in a different way. I think this is because Oracle is usually tuned to quickly get "First Rows" rather than "All Rows".