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

影响:

相关推荐
溪语流沙17 小时前
【Web全栈进阶】PostgreSQL上手:Docker跑库 + 把早报站从SQLite迁过去
前端·docker·postgresql
苦瓜打怪兽17 小时前
PostgreSQL 报错“字段 datlastsysoid 不存在”排查与解决
数据库·postgresql
IvorySQL2 天前
PostgreSQL 日报 |PostgreSQL 19 Beta 4 发布(9 月 25 日)
数据库·postgresql
IvorySQL2 天前
PostgreSQL 日报 | 可见性映射数据损坏修复(9 月 26 日)
数据库·postgresql
一直在努力学习的菜鸟2 天前
PostgreSQL PITR实现时间点误删除恢复
postgresql
IvorySQL2 天前
PostgreSQL 日报| relchecks 溢出导致表无法删除(9 月 28 日)
数据库·人工智能·ai·postgresql·区块链
cpolar技术支持3 天前
本地数据库客户端只能自己用?用 cpolar 安全访问 NAS 上的 PostgreSQL 管理台
postgresql·内网穿透·cpolar·nas·pgadmin
l1t4 天前
DeepSeek总结的pg_clickhouse 与 chdb 更新:编码、嵌套与类型
数据库·clickhouse·postgresql
余槐i5 天前
EXPLAIN 显示走了索引查询仍慢:回表与选择性在 500 万行表上拉开 10 倍耗时
数据库·postgresql·性能优化·vacuum·explain
梦在远山后6 天前
PostgreSQL 锁与死锁:结合 DevMind 讲清楚
python·postgresql·agent