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

影响:

相关推荐
PGCCC2 天前
Ubuntu 安装 PostgreSQL 16 完整教程(2026):从仓库配置到远程连接
linux·ubuntu·postgresql
jnrjian2 天前
postgres database 更换用户
数据库·postgresql
李昊哲小课3 天前
Ubuntu24.04 PostgreSQL 18 完整安装与配置教程
ubuntu·postgresql
IvorySQL3 天前
PostgreSQL 日报|复制槽泄漏修复(8 月 6 日)
数据库·postgresql
喜欢的名字被抢了3 天前
FastAPI 接入异步 PostgreSQL 完成任务 CRUD 与数据库迁移
数据库·postgresql·fastapi
qq21084629533 天前
PostgreSQL、SQLite、Redis、TDengine
redis·postgresql·sqlite
PC2005-cloud3 天前
PgVector从入门到实战:用PostgreSQL做向量检索,附SpringBoot+MyBatisPlus整合
数据库·spring boot·postgresql
jaboo123 天前
postgresql从入门到精通
数据库·postgresql·langchain
IvorySQL4 天前
PostgreSQL 日报|修复 WAL 归档恢复竞态条件(8 月 5 日)
数据库·postgresql·区块链
你不是我我4 天前
【AI 测评】PostgreSQL主从流复制实战:数据同步、状态验证与故障切换
数据库·postgresql