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

影响:

相关推荐
知识的搬运工旺仔4 小时前
唯一索引与 NULL 值:PostgreSQL 主键约束与 NULLS NOT DISTINCT
数据库·后端·sql·postgresql
jnrjian6 小时前
EDB postgresql TDE 加密的文件
postgresql
IvorySQL7 小时前
PostgreSQL 日报|逻辑解码竞态条件修复(9 月 20 日)
数据库·人工智能·postgresql
XMYX-010 小时前
Rocky_Linux_9.8_安装_PostgreSQL_16
postgresql
foolishlee11 小时前
SCRAM-SHA-256
数据库·算法·postgresql
IvorySQL1 天前
IvorySQL 5.6 发布:PG 18.6 内核升级,沙盒即开即用
数据库·人工智能·postgresql
腾科IT教育1 天前
PGCM考试详解:认证价值、含金量及与PGCA、PGCE区别
postgresql·pg·pgcm考试·pgca考试·pgce考试
Zhu7581 天前
docker环境快速部署postgresql数据库18及以上版本
postgresql·容器
l1t1 天前
DeepSeek总结的 pgColumnar 1.0-alpha4 发布说明
数据库·postgresql
Logintern091 天前
“以一致的顺序获取锁“是预防死锁最核心、最有效的手段
python·postgresql·锁机制