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

影响:

相关推荐
知识分享小能手5 小时前
PostgreSQL 入门学习教程,从入门到精通,PostgreSQL 16 服务器配置与数据库监控终极指南 —语法、案例与实战(18)
数据库·学习·postgresql
宇灬宇7 小时前
Oracle 到 PostgreSQL迁移(ora2pg)
数据库·postgresql·oracle
高铭杰7 小时前
Postgresql源码(155)Redo系列CLOG Redo (RM_CLOG_ID = 3)
数据库·postgresql·redo·clog
执笔画情ora9 小时前
pg数据库管理-PostgreSQL 的 COPY TO 和 COPY FROM 命令
数据库·postgresql
爱吃牛肉的大老虎10 小时前
PostgreSQL基础之安装
数据库·postgresql
MrMua10 小时前
mysql与postgresql对比
数据库·mysql·postgresql
程序员夏末11 小时前
【JchatMind智能体 | 第二天】为何选 PostgreSQL + pgvector 而非 MySQL?
数据库·mysql·postgresql·ai编程·ai agent
劈星斩月11 小时前
PostgreSQL-02-数据类型(数字类型)
postgresql·数据类型·浮点类型·数字类型
_半夏曲1 天前
PostgreSQL 13、14、15 区别
数据库·postgresql
Navicat中国1 天前
利用 PostgreSQL 的强大力量:Supabase 简介
数据库·postgresql·navicat·supabase