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

影响:

相关推荐
jcLee9515 小时前
Stolon实现云原生环境下的PostgreSQL高可用架构概述
postgresql·云原生·架构
伊织萌1 天前
在 Ubuntu 22.04 上安装 PostgreSQL
linux·服务器·ubuntu·postgresql·云计算
数据知道1 天前
《深入掌握PostgreSQL数据库》 - 专栏介绍和目录
数据库·postgresql
@@神农1 天前
PostgreSQL- SQL语句的执行过程(二)
数据库·sql·postgresql
Howie Zphile1 天前
FRAPPE v16 +postgresql +insight+wiki安装
数据库·postgresql·frappe·全面预算
l1t2 天前
DeepSeek辅助生成的PostgreSQL 表结构设计幻灯片脚本
数据库·postgresql
l1t2 天前
DeepSeek辅助生成的PostgreSQL 执行计划分析幻灯片脚本
数据库·postgresql
WJX_KOI2 天前
保姆级教程:Apache Flink CDC(standalone 模式)部署 MySQL CDC、PostgreSQL CDC 及使用方法
java·大数据·mysql·postgresql·flink
数据知道2 天前
PostgreSQL:详解 PostgreSQL 与Hadoop与Spark的集成
hadoop·postgresql·spark
数据知道2 天前
PostgreSQL:如何在容器中部署 Crunchy Data Operator(Kubernetes 运维)
运维·postgresql·kubernetes