Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix asyncpg introspection during connection creation #54

Closed
piercefreeman opened this issue Dec 29, 2024 · 0 comments · Fixed by #65
Closed

Fix asyncpg introspection during connection creation #54

piercefreeman opened this issue Dec 29, 2024 · 0 comments · Fixed by #65

Comments

@piercefreeman
Copy link
Owner

piercefreeman commented Dec 29, 2024

Single asyncpg connections invoke an introspection command that can be quite costly on first run with jit enabled - which it is on modern Postgres versions. This is fine when asyncpg connects directly to postgres because it wraps introspection commands in a jit=false flag. However when run behind pgbouncer, the query multiplexing strips out session based commands that toggle state like this, so JIT remains on and the queries become slow.

We need to figure out a way to cache this data internally within the runtime so it's usable across sessions.

MagicStack/asyncpg#530

@piercefreeman piercefreeman changed the title Production Guide Fix asyncpg introspection during connection creation Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant