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

影响:

相关推荐
阿洛学长11 小时前
PostgreSQL 超详细安装与使用教程:从入门到实战
数据库·postgresql
音符犹如代码13 小时前
Docker 一键部署带有 TimescaleDB 插件的 PostgreSQL
java·运维·数据库·后端·docker·postgresql·容器
CCPC不拿奖不改名17 小时前
PostgreSQL数据库部署linux服务器流程
linux·服务器·数据库·windows·python·docker·postgresql
mpHH1 天前
postgresql-分区表
数据库·postgresql
l1t2 天前
在WSL的ubuntu 26.04容器中用deb安装包安装使用redrock-4.1-1
linux·运维·ubuntu·postgresql
Hehuyi_In2 天前
postgres-howto 学习笔记
笔记·学习·postgresql·脚本·how to
Mike117.2 天前
GBase 8c 里 search_path 没管住,SQL 可能跑到另一个对象上
数据库·sql·postgresql
倒流时光三十年2 天前
PostgreSQL 中的 NULL 陷阱:从一次排除过滤说起
java·数据库·postgresql
IvorySQL2 天前
从 repack.c 深入理解 PostgreSQL REPACK 的底层实现
数据库·postgresql·开源