> On 13 Feb 2016, at 11:21, drum(dot)lucas(at)gmail(dot)com wrote:
>
> Anyone can help with that please?
>
> Cheers
What would help is:
1. to post an actual query that you need optimised and
2. an explain analyze of that query.
What you posted in your original message was some kind of query-template with enough placeholders and views that there is no way to predict how that's going to perform without at least knowing what goes into the placeholders and how the views are built up.
Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.