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

影响:

相关推荐
PGCCC4 小时前
通知:中国PostgreSQL培训认证 2026年度开班计划
数据库·postgresql
Linging_248 小时前
PGSQL与Mysql对比学习
数据库·学习·mysql·postgresql
alex18018 小时前
nginx配置图片静态路由
数据库·nginx·postgresql
羑悻的小杀马特12 小时前
PostgreSQL + Cpolar 组合拳,彻底打破局域网限制,远程访问数据库像本地一样简单
数据库·postgresql
玄同76521 小时前
Python「焚诀」:吞噬所有语法糖的终极修炼手册
开发语言·数据库·人工智能·python·postgresql·自然语言处理·nlp
磊磊cpp21 小时前
Ubuntu 22.04 离线安装教程(本地 APT 仓库 offline-repo)
数据库·ubuntu·postgresql
赵渝强老师1 天前
【赵渝强老师】国产金仓数据库的数据库对象
数据库·postgresql·oracle·oceanbase·国产数据库
Mr.徐大人ゞ1 天前
6.用户及权限管理
数据库·postgresql
Dxy12393102161 天前
PostgreSQL 如何使用执行计划:从入门到实战调优
mysql·postgresql·架构
扑火的小飞蛾1 天前
PostgreSQL 16.1 安装指南
数据库·postgresql