pg pg_prewarm用法

按照插件

bash 复制代码
> create extension pg_prewarm ;

缓存表

bash 复制代码
> test=# select pg_prewarm('weather','buffer' ) ;  pg_prewarm
> ------------
>           1

缓存表部分内容

bash 复制代码
test=# select pg_prewarm('weather','buffer','main',0,0) ;
 pg_prewarm
------------
          1
(1 row)

表大小只有0号页,只能缓存这么大

缓存索引

bash 复制代码
test=# \d+ weather
                                                  Table "public.weather"
  Column   |         Type          | Collation | Nullable | Default | Storage  | Compression | Stats target | Description
-----------+-----------------------+-----------+----------+---------+----------+-------------+--------------+-------------
 city      | character varying(80) |           |          |         | extended |             |              |
 temp_low  | integer               |           |          |         | plain    |             |              |
 temp_high | integer               |           |          |         | plain    |             |              |
 prcp      | real                  |           |          |         | plain    |             |              |
 date      | date                  |           |          |         | plain    |             |              |
Indexes:
    "idx_city" btree (city)
Access method: heap

test=# select pg_prewarm('idx_city','buffer' ) ;
 pg_prewarm
------------
          2

影响:

相关推荐
瀚高PG实验室1 小时前
PostgreSQL libpq lo_* 函数允许服务器超级用户覆盖客户端栈内存HGVE-2026-E011
服务器·数据库·postgresql·瀚高数据库
Wang's Blog10 小时前
PostgreSQL笔记60: 权限与角色管理——从层级体系到最佳实践
数据库·笔记·postgresql
Wang's Blog16 小时前
PostgreSQL笔记28: PostgreSQL ACID 特性与实现机制深度解析
大数据·笔记·postgresql
勇往直前plus16 小时前
Docker PostgreSQL 16 部署要点(Ubuntu 22)
ubuntu·docker·postgresql
Wang's Blog21 小时前
PostgreSQL笔记59:行列级权限机制与数据脱敏实践
数据库·笔记·postgresql
Wang's Blog1 天前
PostgreSQL笔记62: 分区表维护最佳实践——默认分区、锁策略与性能调优
数据库·笔记·postgresql
Wang's Blog1 天前
PostgreSQL笔记58: 性能监控工具全景——从内核指标到操作系统诊断
数据库·笔记·postgresql
残 风2 天前
PostgreSQL 存储机制详解
数据库·postgresql·开源·数据库开发
ylj_dev2 天前
从 0 构建 AI Workload Platform(四):从单机工作流内核到可靠控制面
docker·postgresql·架构·golang
Wang's Blog2 天前
PostgreSQL笔记48: 全文检索与向量检索的对比与混合检索实践
笔记·postgresql·全文检索