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

影响:

相关推荐
逻辑君6 小时前
如何在PostgreSQL里删除和增加数据库
数据库·postgresql
数据知道10 小时前
PostgreSQL:详解 PostGIS 地理信息数据处理
数据库·postgresql
数据知道12 小时前
PostgreSQL:如何把PostgreSQL变成时序数据库(TimescaleDB)
数据库·postgresql·时序数据库
l1t1 天前
DeepSeek总结的Postgres 查询中的读取效率问题
数据库·postgresql
p***19941 天前
实操解决Navicat连接postgresql时出现‘datlastsysoid does not exist‘报错的问题
数据库·postgresql
coollove74821 天前
Linux下PostgreSQL-12.0安装部署详细步骤
linux·运维·postgresql
yuyuyuliang001 天前
Ubuntu 22.04安装PostgreSQL教程
linux·运维·ubuntu·postgresql
数据知道1 天前
PostgreSQL:详解 pgAudit 插件的使用(数据脱敏与审计)
数据库·postgresql
l1t1 天前
在debian 13.1容器中安装使用redrock postgresql
运维·postgresql·debian
数据知道1 天前
PostgreSQL:如何配置数据库的传输层加密(SSL加密连接)
数据库·postgresql·ssl