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

影响:

相关推荐
Vd7H20A720 小时前
TencentOS Server 3.3 安装 PostgreSQL 18 完整指南
数据库·postgresql
IvorySQL2 天前
PostgreSQL 技术日报 (6月8日)|索引预取迭代,AI 安全功能上新
数据库·人工智能·sql·安全·postgresql
睡不醒男孩0308232 天前
CLup篇之PostgreSQL管理
数据库·postgresql
瀚高PG实验室2 天前
数据库启动报错:42501: 无法打开共享内存段 “/PostgreSQL.******“: 权限不够
数据库·postgresql·瀚高数据库
睡不醒男孩0308232 天前
第十篇:PostgreSQL 生产环境高可用选型:CLUP 与 Patroni 深度架构对比与踩坑实录
数据库·postgresql·架构
花间相见2 天前
【AI工作流搭建n8n】—— Docker + PostgreSQL 生产环境部署全攻略:MCP 集成与 Skills 技能实战
人工智能·docker·postgresql
小二·2 天前
PostgreSQL 高级特性与性能调优
数据库·postgresql
_未闻花名_2 天前
PostgreSQL的若干扩展安装和使用
spring boot·postgresql·postgis·timescaledb·pg_cron·pgmq·zhparser
取名好樊2 天前
Windows Docker PostgreSQL 端口绑定失败问题记录
windows·docker·postgresql
逍遥德2 天前
PostgreSQL --- 二进制数使用详解
数据库·sql·postgresql