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

影响:

相关推荐
倒流时光三十年12 小时前
PostgreSQL Semi-Join(半连接)通俗讲解
数据库·postgresql
IvorySQL16 小时前
PostgreSQL 日报| RI 快速路径并发读取缺陷(8 月 13 日)
数据库·postgresql
一只fish1 天前
优化器架构对比:Oracle vs PostgreSQL vs MySQL
mysql·postgresql·oracle
ClouGence1 天前
PostgreSQL 同步到 Iceberg:开源、私有部署与 SaaS 方案对比
数据库·postgresql·开源
l1t2 天前
DeepSeek总结的在 pg_stat_statements 中诊断高基数工作负载
数据库·缓存·postgresql
测试运维日常笔记2 天前
PostgreSQL 数据库磁盘空间占用排查手顺
数据库·postgresql·oracle
IvorySQL2 天前
PostgreSQL 日报|PG18.5 回归测试崩溃问题(8 月 12 日)
大数据·数据库·人工智能·postgresql
叶 落3 天前
Ubuntu24 安装 PostgreSQL
数据库·postgresql·安装教程
copyer_xyf4 天前
Agentic RAG 实战:PostgreSQL + LangGraph 一条链路
python·postgresql·agent
jnrjian4 天前
EDB PEM 安装加强 curl
postgresql