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

影响:

相关推荐
工业一体机老司机18 小时前
rsync+inotify 收集车间工位机日志的完整配置
服务器·数据库·postgresql
IvorySQL20 小时前
PostgreSQL 日报|布尔列 NOT 选择率估算偏高(12 月 4 日)
数据库·postgresql
无级程序员1 天前
dolphinscheduler3.x从mysql迁移到postgresql
数据库·mysql·postgresql
夜雪一千1 天前
PostgreSQL 的触发器如何写
linux·数据库·postgresql
IvorySQL1 天前
PostgreSQL 日报|拟废弃 money 类型(12 月 3 日)
数据库·postgresql
爆米花byh1 天前
在RockyLinux9环境的RedRock18.7单机版安装与配置(PostgreSQL 企业级发行版)
linux·数据库·postgresql·database
禾小西2 天前
Navicat 通过 SSH 跳板连接 PostgreSQL:双服务器配置与排障实录
服务器·postgresql·ssh
夜雪一千2 天前
PostgreSQL 自定义函数入门
数据库·postgresql
姚远Oracle ACE2 天前
如何根据工作负载调优 PostgreSQL work_mem
数据库·postgresql
wyd200403032 天前
开源 AnyLink Agent:跨设备 Agent 协作协议与云端共享记忆实践
人工智能·分布式·postgresql·开源·智能体·openclaw·共享记忆