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

影响:

相关推荐
瀚高PG实验室9 小时前
pgsql-ogr-fdw
数据库·postgresql·瀚高数据库·highgo
IvorySQL9 小时前
PostgreSQL 技术日报 (6月5日)|PG19 Beta1 上线,PGConf.PL 2026开启征稿
数据库·postgresql·区块链
IvorySQL15 小时前
【HOW 2026 分论坛演讲】PG/IvorySQL私有云中实践
数据库·人工智能·sql·postgresql
倒流时光三十年16 小时前
PostgreSQL ON CONFLICT DO UPDATE 增加 WHERE 条件优化性能
数据库·postgresql
IvorySQL16 小时前
PostgreSQL 技术日报 (6月1日)|逻辑复制问题修复,AI 行业动态速览
数据库·人工智能·postgresql
*neverGiveUp*18 小时前
PostgreSql常用SQL大全
数据库·sql·postgresql
倒流时光三十年21 小时前
PostgreSQL HOT 优化 - 大白话解释
数据库·postgresql·hot
有想法的py工程师1 天前
PostgreSQL分区表父索引INVALID排查实战:缺少某个分区索引导致父索引INVALID
数据库·postgresql
睡不醒男孩0308231 天前
数据库高可用运维实操指南:基于CLup的PostgreSQL生产环境自动化管理
运维·数据库·postgresql
本地化文档2 天前
psycopg3-docs-l10n
数据库·python·postgresql·github·gitcode·sphinx