Use a single prepared statement for each kind of subquery instead of ad-hoc ones.
Also you checkout a new connection for each from the pool, that’s another cost factor, try to reuse a single connection.
Use a single prepared statement for each kind of subquery instead of ad-hoc ones.
Also you checkout a new connection for each from the pool, that’s another cost factor, try to reuse a single connection.