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

影响:

相关推荐
花酒锄作田7 小时前
Postgres - Listen/Notify构建轻量级发布订阅系统
python·postgresql
IvorySQL13 小时前
PostgreSQL 技术日报 (4月7日)|内核开发新动态,多项功能优化落地
数据库·postgresql·开源
IvorySQL14 小时前
PostgreSQL 技术日报 (4月6日)|内核补丁与性能优化速递
数据库·postgresql·开源
IvorySQL14 小时前
PostgreSQL 技术日报 (4月5日)|六大核心补丁进展,生产环境必看
数据库·postgresql·开源
IvorySQL14 小时前
走进高校,走近开源|IvorySQL 社区即将亮相应急管理大学开源学术报告会
数据库·postgresql·开源
你都会上树?19 小时前
Ubuntu22 安装PostgreSQL
数据库·postgresql
IvorySQL19 小时前
PostgreSQL & IvorySQL 技术交流 Meetup・郑州站| 4.18 线下开讲,只聊硬核技术
数据库·postgresql·开源
我是永恒2 天前
PostgreSQL数据库安装配置连接Paperclip
数据库·postgresql
oG99bh7CK2 天前
FastAPI + PostgreSQL 实战:从入门到不踩坑,一次讲透
数据库·postgresql·fastapi
taWSw5OjU2 天前
FastAPI + PostgreSQL 实战:给应用装上“缓存”和“日志”翅膀
缓存·postgresql·fastapi