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

影响:

相关推荐
m0_653031361 小时前
PostgreSQL技术大讲堂 - 第97讲:PG数据库编码和区域(locale)答疑解惑
数据库·postgresql
kfepiza1 天前
PostgreSQL入门笔记250718
postgresql
Dontla2 天前
Postgres介绍(PostgreSQL)(开源对象关系型数据库管理系统)(与Mysql对比)
数据库·postgresql·开源
__风__4 天前
PostgreSQL ExecInitIndexScan 函数解析
数据库·postgresql
中文很快乐4 天前
postgreSQL的sql语句
数据库·sql·postgresql
····懂···4 天前
如何成为 PostgreSQL 中级专家
数据库·postgresql
dingdingfish4 天前
PostgreSQL 16 Administration Cookbook 读书笔记:第6章 Security
postgresql·database·security·administration·cookbook
小至尖尖4 天前
FastCDC 项目启动玩玩 😁😁😁😁
postgresql·sql优化
mini小新5 天前
PostgreSQL如何进行跨服务器迁移数据
服务器·数据库·postgresql·数据迁移