database/sql: Avoid re-preparing statements when all connections are busy
Previously, if all connections were busy, we would always re-prepare the statement on the connection we were assigned from the pool. That meant that if all connections were busy most of the time, the number of prepared statements for each connection would keep increasing over time. Instead, after getting a free connection, check to see if the statement has already been prepared on it, and reuse the statement handle if so. LGTM=bradfitz R=golang-codereviews, gobot, bradfitz CC=golang-codereviews https://golang.org/cl/116930043
Showing
Please register or sign in to comment