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

影响:

相关推荐
jun_bai4 小时前
postgresql数据库免安装版安装到windows系统
数据库·postgresql
BullSmall5 小时前
CentOS7 阿里云 PG 镜像 PG10.9 → PG17 完整升级指南
阿里云·postgresql·centos
瀚高PG实验室5 小时前
DELETE 条件字段缺少索引导致 SuperSync 同步严重延迟
数据库·postgresql·瀚高数据库
IvorySQL10 小时前
PG 日报|修复高 IO 并发场景,解决预读机制耗尽本地缓冲区缺陷
数据库·人工智能·sql·postgresql·区块链
想你依然心痛12 小时前
电力能耗系统怎么搭,Django 加 PostgreSQL 入门指南
postgresql·django·电力能耗系统,后端开发
凌虚2 天前
基于 PostgreSQL WAL 构建 CDC 系统:原理与工程实现
数据库·后端·postgresql
BullSmall2 天前
PostgreSQL 14 pg_dumpall 完整备份指南
数据库·postgresql·oracle
jnrjian4 天前
\dx Postgres 查看EXTENSION
postgresql
Lihua奏4 天前
高可用与扩展:一台 PostgreSQL 不够用之后怎么办?
postgresql