Problem
The current implementation creates a new PostgreSQL connection for each query
via psycopg2.connect().
While acceptable for early development, this may become inefficient under load
and should be optimized.
Current State
get_connection() opens a new DB connection on every call
- No connection reuse or pooling is used
Proposed Improvements
- Introduce connection pooling (e.g.
psycopg2.pool or similar)
- Or maintain a shared connection managed by the application lifecycle
Notes
This is not critical for MVP correctness but should be addressed before
production or higher load scenarios.