slow queries

There is no pat answer to issues like this.

You’ll want to use the EXPLAIN feature of your database to help identify where the bottlenecks may be within the query. Generally, improvements are going to be made by either adding indexes where appropriate, or possibly even restructuring the query if there are a lot of joins involved. It may even end up being necessary to restructure the tables if there’s no other avenue for improvement.

I’m not sure I understand what you mean by:

If you’re talking about query expressions calculating values being the time-consuming operations, then optimizing these may take a fair bit of work.

But it all depends on the specifics. There really isn’t a way to generalize this.