jackc / jackc/pgx

Performance issues with pgxpool

Open
#729 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

Okay, so I just switched to using the pgx interface from database/sql for everything. I think database/sql has it's own default connection pool so I tried to use the pgxpool(v4) with pgx. It is just a basic program that finds all video files in a folder and all it's children. Anyway, its heavily uses goroutines. So here are the timings:
```
pgx with database/sql: 2 min 54 sec
pgxpool : 7 min 54 sec
```

The folder size is 412 GB with 1390 items. The documentation for pgxpool is pretty much non existent. So I'm currently using Exec() method for write queries and Query() for others. I'm a noob so well, it is probably my fault. [Here](https://github.com/Ayush1325/stream_server) is the link to the repo. So well, can anyone provide any suggestions or point to some sources on how to use pgx well?

Contributor guide

Open the contributing guide

Research direction

Start with the linked stream_server repository and its pgxpool(v4) usage, especially the Exec() and Query() calls described in the issue; reproduce the comparison against database/sql if possible. A useful contribution would first need a narrowed, reproducible cause and an agreed performance or documentation outcome, since the issue currently asks for general advice.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.