I'm trying to use database/sql with gocql, a driver for cassandra in an app
that has hundreds of concurrent goroutines and connections. What I'm
observing is a very high rate of having connections with prepared
statements being stolen by other goroutines. Much of my code uses
db.Query(), which internally does a db.Prepare() followed by a stmt.Query,
but (by adding debug code) I observe that when the stmt.Query tries to use
the connection with the prepared statement it has actually been stolen by a
different goroutine and the statement has to be re-prepared. Specifically,
I see it hitting the "if !match" case in stmt.connStmt() very frequently.
What is the purpose of releasing the connection with the prepared statement
to the pool in the first place?