Expand description
v6.5.0 PreparedStatement 句柄缓存
缓存数据库侧 PreparedStatement 句柄,按连接分桶(句柄绑定连接),
跨连接共享 LRU 淘汰顺序。与既有 PlanCache(应用侧 AST 缓存)职责分离。
特性:
- 按连接 ID 分桶(SQLx prepared statement 绑定连接)
- bucket 级别 LRU 淘汰(max_size_per_conn 上限)
- 表级精确失效(table_index 索引)
- 连接级失效(invalidate_conn,连接关闭时调用)
- 原子统计(命中/未命中/淘汰/降级/失效)
- 句柄以闭包形式存储(避免在 sz-orm-core 暴露 SQLx 类型)
Structs§
- Prepared
Statement Cache - PreparedStatement 句柄缓存
- Prepared
Statement Cache Stats - PreparedStatement 缓存统计(原子计数器)
- Prepared
Statement Cache Stats Snapshot - 统计快照(用于读取一致性视图)
Enums§
- Prepared
Lookup - 缓存查找结果
Functions§
- extract_
tables_ simple - 从 SQL 中提取表名(简单字符串扫描,不依赖 sqlparser)