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

影响:

相关推荐
ss2731 天前
为什么PostgreSQL适合AI场景?
数据库·人工智能·postgresql
考虑考虑2 天前
Posrgresql恢复.backup文件
数据库·后端·postgresql
Jesse_EC2 天前
换乘次数最少的路径 SQL 查询详解与实战经验——从 WITH RECURSIVE 到 pgRouting
数据库·postgresql
zhangjw342 天前
1-6 PostgreSQL 特色类型实战:数组、JSON & JSONB、枚举、范围类型
数据库·postgresql
IvorySQL2 天前
深入 PostgreSQL WAL:从崩溃恢复到逻辑复制
数据库·postgresql
FungLeo3 天前
成为全栈·Go 后端篇·从 Node SQLite 到 PostgreSQL:把迁移做成独立交付物
postgresql·golang·sqlite·go·数据库迁移·成为全栈
Small-Young3 天前
数据库乐观锁深度解析:MySQL、PostgreSQL 实战 + Spring Boot 集成指南
数据库·spring boot·mysql·postgresql·乐观锁·并发控制
瀚高PG实验室3 天前
瀚高数据库运行日志(错误日志)查看与分析方法
数据库·postgresql·瀚高数据库
snow@li3 天前
PostgreSQL:PostgreSQL(PG)全景深度梳理
数据库·postgresql
瀚高PG实验室3 天前
HGHAC集群版本升级
数据库·postgresql·瀚高数据库