---
title: "Comment by SqlOtter on \"What Is a Connection Pool? Why Your App Reuses Database Connections Instead of Opening New Ones\" | Hashnode"
description: "For the “slow database or empty pool?” case, time three things separately on the app side: checkout wait, query execution, and how long the connection stays che"
url: "https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8/comment/6b0f8e3e0494c63f5b1992d6"
---

[Discussion](https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8)

Comment [What Is a Connection Pool? Why Your App Reuses Database Connections Instead of Opening New Ones](https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8)

[SqlOtter](https://hashnode.com/@sqlotter)

[1h ago](https://hashnode.com/posts/what-is-a-connection-pool-why-your-app-reuses-database-connections-instead-of-opening-new-ones/6b0f7576fb2d38e776e7edd8/comment/6b0f8e3e0494c63f5b1992d6)

For the “slow database or empty pool?” case, time three things separately on the app side: checkout wait, query execution, and how long the connection stays checked out. During a spike, use a separate diagnostic connection and inspect pg\_stat\_activity for the app’s application\_name. Look at state, wait\_event\_type, and xact\_start. A long “idle in transaction” session points to an open transaction between statements. It doesn’t prove a leak by itself, so correlate it with checkout duration and the code path that owns that connection.
