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

Implement Close for prepared statements #482

Merged
merged 6 commits into from
Jun 19, 2023
Merged

Implement Close for prepared statements #482

merged 6 commits into from
Jun 19, 2023

Conversation

levkk
Copy link
Contributor

@levkk levkk commented Jun 18, 2023

Features

Add support for Close (F). In transaction mode, the prepared statement will be removed from the client cache, but not from the server cache. In session mode, the prepared statement will be removed from both server and client caches and from the Postgres server itself.

Add prepared statement cache size limit, with a cleanup job that removes statements that are above cache size. Cost of removal is amortized across clients, not ran as a maintenance loop out of connection lifetime. We need to write our own internal pool implementation to add the ability to run maintenance on connections out of usage scope. I think the impact at the moment will be mostly negligible because cache eviction should only be active on very active systems that are constantly used, so running a cleanup job out of client usage scope will still block the connection when it's needed.

Bugs

Fixed what may have been a big latency bottleneck caused by incorrect arc_swap usage to fetch the idle in transaction config value.

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 this pull request may close these issues.

1 participant