ordering and optimizing functions

If you think that you are making too many DB requests then you need to reorganize the way you store your data to be more efficient.

It might even be totally irelevant if you employ the right type of caching. If your visitors are usually not logged in then a full page caching that W3TC, super cache, or other plugin do will nullify the concern. Even if not, result caching with object cache will probably mitigate the problem.