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

影响:

相关推荐
AI的探索之旅3 小时前
从 Ubuntu 14.04 到 24.04:TI AM335x 开发环境完整迁移与 Agent 接管方案
linux·数据库·嵌入式硬件·ubuntu·postgresql
IvorySQL1 天前
PG 技术日报|2026-07-04
数据库·人工智能·postgresql·开源
IvorySQL1 天前
IvorySQL HTAP 实时湖仓接入引擎
数据库·postgresql·开源·htap·ivorysql
IvorySQL1 天前
PostgreSQL 技术日报|2026-07-05
数据库·postgresql
岳麓丹枫0011 天前
PgBouncer使用笔记
postgresql
啵啵鱼爱吃小猫咪1 天前
Franka机械臂安装实时内核
数据库·postgresql
小杍随笔1 天前
【Rust全栈项目接入UUID主键实战:从选型到PostgreSQL适配(含v7优化)】
开发语言·postgresql·rust
倒流时光三十年2 天前
PostgreSQL to_json 与 row_to_json:妙用与区别详解
数据库·postgresql·json
IvorySQL2 天前
PG 技术日报|2026-07-03
数据库·postgresql·开源
甘露s2 天前
为什么 GIS 系统更青睐 PostgreSQL?
数据库·postgresql