You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If any arguments are passed to Query, lib/pq appears to prepare the statement under the hood. In some workloads, this creates a constant workload of parse, bind, select, parse, bind, select, parse, bind, select, etc on the server if all queries are just one-shot.
It seems like it would be better to only prepare the statement when calling DB.Prepare and use the Stmt interface to issue the query. This way, a developer can avoid the round-trip overhead of prepared statements when they know their workload does not benefit from it.