Enabling statement cache for PostgreSQL #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tight code, short PR, nice!
src/connector/postgres.rs
Outdated
@@ -226,6 +236,7 @@ impl PostgresUrl { | |||
let mut socket_timeout = None; | |||
let mut connect_timeout = None; | |||
let mut pg_bouncer = false; | |||
let mut statement_cache_size = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably figure things out as we start using it, but for other quaint users, if it works we may want to default to a non-zero size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to enable this to everybody by default. Should be opt-in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no other way to reuse prepared statements currently, so this should at least to be well documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Making the default here to 500. Let's see...
- Quaint PR: prisma/quaint#143 - Issue: prisma/prisma#2720
- Quaint PR: prisma/quaint#143 - Issue: prisma/prisma#2720
* Caching postgres statements * Enabling statement caching for PostgreSQL - Quaint PR: prisma/quaint#143 - Issue: prisma/prisma#2720 * Disabling statement caching on ME
Adds a new parameter
statement_cache_size
to enable statement caching for PostgreSQL. By default 0, meaning no cache. Ifpgbouncer
flag is on, cache will be disabled.issue: prisma/prisma#2720