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

影响:

相关推荐
周杰伦的稻香5 小时前
PostgreSQL中的METHOD(认证方法)
数据库·postgresql
Zhu7586 小时前
对docker环境的postgresql数据库做快速初始化
数据库·docker·postgresql
l1t1 天前
测试用rust重写的postgresql: pgrust
开发语言·postgresql·rust
IvorySQL2 天前
云环境下PostgreSQL的Cgroup内存管理实践
java·数据库·postgresql
IvorySQL3 天前
PG 日报|SQL/PGQ 图查询基于联接重写机制实现
数据库·人工智能·sql·postgresql·区块链·ivorysql
IvorySQL3 天前
深度拆解 IvorySQL 去 O 核心解决方案
数据库·人工智能·postgresql
大猫会长3 天前
mac安装PostgreSQL18笔记
postgresql
IvorySQL4 天前
PG 日报|新增 VACUUM 全维度统计信息补丁迭代
数据库·人工智能·postgresql·ivorysql
运维老郭4 天前
PostgreSQL编译安装实战
运维·postgresql
l1t4 天前
DeepSeek总结的RegreSQL 2.0测试通过了。计划却没通过。
linux·数据库·postgresql