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

影响:

相关推荐
小当家.10513 小时前
PostgreSQL 做向量数据库:pgvector 在 RAG 中的实战与多场景适配
数据库·人工智能·postgresql·rag
倒流时光三十年14 小时前
PostgreSQL 部分索引(Partial Index)详解
数据库·postgresql·partial index·部分索引
Gauss松鼠会20 小时前
GaussDB(DWS)性能问题处理套路
服务器·数据库·postgresql·性能优化·gaussdb
夜郎king20 小时前
PostgreSQL 16 搭配 PgVector:Windows 11 完整安装教程
数据库·windows·postgresql
或与且与或非1 天前
postgresql+rabbitmq集群搭建方案
数据库·postgresql·rabbitmq
zhz52141 天前
Docker 部署 MongoDB / MySQL / PostgreSQL 安全加固实录:TLS 双向认证、双因素鉴别与审计
mysql·mongodb·docker·postgresql·等保
auspicious航2 天前
PostgreSQL逻辑复制全解析:从原理到跨区域实战
数据库·postgresql
暴躁小师兄数据学院2 天前
【AI大数据工程师特训笔记】第03讲:运算符
数据库·postgresql
安当加密2 天前
TDE透明加密性能实测:AES-NI加速能跑多快?MySQL/PostgreSQL/SQL Server三数据库对比
数据库·mysql·postgresql
倒流时光三十年2 天前
PostgreSQL EXISTS vs IN 性能对比详解
postgresql·in·exists