In operations query, information from some filters can be used to improve performance of the other
For instance, if we only filter by
fee, the condition can be:
CASE WHEN oa.operation_kind = 8 THEN tran.fee WHEN oa.operation_kind = 10 THEN deleg.fee WHEN oa.operation_kind = 7 THEN reveal.fee WHEN oa.operation_kind = 9 THEN orig.fee ELSE NULL::bigint END = filter.fee
But in case in the same query we have a filter on
operation_kind == 8 then we can limit
tran.fee = filter.fee
Which is much simpler and depending on how the query optimizer works, can be much faster.