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

影响:

相关推荐
PGCCC_14 小时前
PostgreSQL 16 流复制主从搭建实战:从踩坑到明白
postgresql
Wang's Blog16 小时前
PostgreSQL笔记9: psql 客户端——从入门到精通
数据库·笔记·postgresql
渣渣盟18 小时前
误删数据之后:MySQL、PostgreSQL、Oracle三库紧急恢复完全实操手册
mysql·postgresql·oracle
Wang's Blog18 小时前
PostgreSQL笔记10:pgAdmin与DBeaver图形化管理工具详解
数据库·笔记·postgresql
程序员AlbertTu19 小时前
Linux 系统 Bug 调试操作手册
linux·postgresql·bug
Wang's Blog20 小时前
PostgreSQL笔记12:PGDATA 数据目录结构与核心文件深度解析
数据库·笔记·postgresql
Wang's Blog2 天前
PostgreSQL笔记8: 基于二八法则的基础性能调优
数据库·笔记·postgresql
茶本无香2 天前
通用报表自动化框架:Java调用Shell传参执行PostgreSQL SQL模板
java·sql·postgresql·shell
求索实验室2 天前
1368次实验证明:PostgreSQL对数据倾斜的基数估计无解——我的AI4S参赛实录
postgresql·ai编程
Wang's Blog3 天前
PostgreSQL笔记4: 市场地位、生态全景与行业应用实践
数据库·笔记·postgresql