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

影响:

相关推荐
IvorySQL6 小时前
PostgreSQL 日报|在线校验和特性被回退(9 月 17 日)
数据库·人工智能·postgresql
geovindu6 小时前
sql:Data Modeling Patterns using PostgreSQL 18
postgresql·数据库开发·数据库架构
l1t10 小时前
DeepSeek总结的PostgreSQL 19 发生了什么
数据库·postgresql
TechWJ1 天前
没有公网 IP 也想远程连 PostgreSQL?从本地数据库到固定 TCP 地址完整配置
大数据·数据库·网络安全·postgresql·内网穿透
あ-1 天前
postgres创建只读用户
postgresql
IvorySQL1 天前
PostgreSQL 日报|8 字节 TOAST 值支持(9 月 16 日)
数据库·人工智能·postgresql
IvorySQL1 天前
AI 时代,PostgreSQL 正在发生什么变化?
数据库·人工智能·postgresql
风哥2号1 天前
数据库教程FGMT50‑PostgreSQL体系结构深入与源码解析
数据库·postgresql
风哥2号2 天前
数据库教程FGMT52‑PostgreSQL用户权限与安全管理
数据库·postgresql
IvorySQL2 天前
PostgreSQL 日报|大模型破解在线校验和(9 月 15 日)
数据库·人工智能·postgresql