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

影响:

相关推荐
Wang's Blog30 分钟前
PostgreSQL笔记37:数据库性能瓶颈排查方法论与工具链
数据库·笔记·postgresql
Wang's Blog34 分钟前
PostgreSQL笔记23:Checkpoint机制与脏页处理深度解析
笔记·postgresql
kUhzIPVBnE10 小时前
fpga can控制器Verilog,节省你的电路板面积 ...altera、xilinx工程...
postgresql
夏炳辉.13 小时前
PostgreSQL 高可用集群核心配置参数全解:从原生流复制到 Patroni 企业级方案
数据库·postgresql
Wang's Blog1 天前
PostgreSQL笔记29:事务隔离级别深度解析——从MVCC快照到SSI可串行化
数据库·笔记·postgresql
SelectDB技术团队1 天前
15 分钟搭建 PostgreSQL + Apache Iceberg + Apache Doris 的湖仓分析平台
数据库·postgresql·apache
Wang's Blog1 天前
PostgreSQL笔记33: 索引底层原理、扫描类型与属性体系深度解析
数据库·笔记·postgresql
SomeOtherTime2 天前
Postgresql触发器实现对表的日志审计
数据库·postgresql
Wang's Blog2 天前
PostgreSQL笔记16: 索引基础——概念、类型、创建与最佳实践
数据库·笔记·postgresql
Wang's Blog2 天前
PostgreSQL笔记24: Background Writer 后台写进程的原理、参数调优与可观测性演进
数据库·笔记·postgresql