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

影响:

相关推荐
摇滚侠15 小时前
全面掌握PostgreSQL关系型数据库,备份和恢复,笔记46和笔记47
java·数据库·笔记·postgresql·1024程序员节
auspicious航17 小时前
PostgreSQL数据库关于pg_rewind的认识
数据库·postgresql·oracle
摇滚侠18 小时前
全面掌握PostgreSQL关系型数据库,设置远程连接,笔记05,笔记06
java·数据库·笔记·postgresql
mpHH18 小时前
postgresql plancache --doing
数据库·学习·postgresql·1024程序员节
2301_800256111 天前
地理空间数据库作业笔记——查询最偏僻的城市
数据库·笔记·sql·postgresql·1024程序员节
best_virtuoso1 天前
PostgreSQL ST_Intersects、ST_Crosses 和 ST_Overlaps的含义与区别
数据库·postgresql
yuer55311 天前
ubuntu22+postgresql18启动报错
ubuntu·postgresql·en_us.utf-8
xuejianxinokok2 天前
io_uring 快吗? Postgres 17 与 18 的基准测试
数据库·后端·postgresql
biubiubiu07063 天前
Ubuntu中定时任务测试
数据库·postgresql
IvorySQL3 天前
灾难恢复工具内核细节探究与分享
数据库·postgresql·开源