Skip to content

Add TTL to prepared statements #1319

Description

@levkk

Add a TTL (time to live) setting for prepared statements and evict (and re-prepare) them on server connections when they expire.

This is to ensure that stale execution plans don't linger around for too long.

Couple settings I think would be good here:

[general]
prepared_statements_ttl = 300_000 # 5min default
prepared_statements_ttl_jitter = 1_000 # 1s, avoid thundering herd when evicting

Jitter helps avoid a thundering herd since most statements will be prepared around the same time.

Metadata

Metadata

Assignees

Labels

bleeding edgeExciting new frontier stuff.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions