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

影响:

相关推荐
九皇叔叔10 小时前
PostgreSQL/openGauss pg_stats 视图从入门到精通:统计信息、执行计划与慢 SQL 优化实战
数据库·sql·postgresql
IvorySQL20 小时前
PostgreSQL 技术日报 (5月31日)|内核功能研讨,PG 大会赛事动态
数据库·postgresql
阿坤带你走近大数据21 小时前
Postgresql的介绍
数据库·postgresql·关系型数据库
阿坤带你走近大数据1 天前
GREENPLUM的介绍
数据仓库·postgresql·pgsql·mpp
逍遥德1 天前
PostgreSQL ---【序列】用法详解
数据库·后端·sql·postgresql
逍遥德1 天前
PostgreSQL --- 自增主键【序列】的避坑指南
数据库·后端·sql·mysql·postgresql·sqlserver
l1t1 天前
DeepSeek总结的PostgreSQL 19 中的 SQL/PGQ:无需图数据库的图查询
数据库·sql·postgresql
xhaxy1 天前
pgsql下载安装(CentOS7,pgsql14)
postgresql
逍遥运德2 天前
PostgreSQL ---【序列】用法详解
后端·sql·postgresql
l1t2 天前
DeepSeek总结的PostgreSQL 的开源 TDE:pg_tde
数据库·postgresql·开源