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 小时前
使用 DBeaver 还原 PostgreSQL 备份文件 (.bak) 技术文档
数据库·postgresql
l1t9 小时前
DeepSeek总结的PostgreSQL使用 RDTSC 降低 EXPLAIN ANALYZE 的计时开销
数据库·postgresql
l1t10 小时前
DeepSeek总结的PostgreSQL检查点和写入风暴
jvm·postgresql·oracle
丸辣,我代码炸了13 小时前
用 PostgreSQL 一库模拟 MySQL / MongoDB / Redis / Elasticsearch(附 ts_rank 详解)
mysql·mongodb·postgresql
XDHCOM1 天前
PostgreSQL 25001: active_sql_transaction 报错原因分析,故障修复步骤详解,远程处理解决方案
数据库·sql·postgresql
卤炖阑尾炎1 天前
PostgreSQL 日常运维全指南:从基础操作到备份恢复
运维·数据库·postgresql
AC赳赳老秦1 天前
OpenClaw数据库高效操作指南:MySQL/PostgreSQL批量处理与数据迁移实战
大数据·数据库·mysql·elasticsearch·postgresql·deepseek·openclaw
ego.iblacat1 天前
PostgreSQL 数据库
数据库·postgresql
亮子AI1 天前
【PostgreSQL】推荐几个PostgreSQL管理工具
数据库·postgresql
丸辣,我代码炸了1 天前
PostgreSQL 大数据查询与索引优化核心总结
大数据·数据库·postgresql