There are a few places where the number of queries can be cut down significantly. My testing indicates that even cutting everything down to just a couple of queries doesn't really change performance much as it's just a move from a lot of little, fast queries to a few slower ones. (Caching or improving the regex stuff would have a much bigger effect.) However the point has been brought up that some hosts limit the number of queries per hour, so it would be good to reduce the number we use. I also think that, in principle, we should try to use as few queries as possible.
So, if you would like to help with this bit of optimization, please post to this thread. We all understand the concepts, so don't preach, just show some SQL and PHP code.