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

影响:

相关推荐
秉承初心2 天前
PostgreSQL 数据性能瓶颈突破实战
数据库·postgresql·oracle
IvorySQL2 天前
PostgreSQL 技术日报 (6月15日)|PG19 性能优化推进,POSETTE 大会倒计时 2 天
数据库·人工智能·postgresql·开源
IvorySQL2 天前
PostgreSQL 技术日报 (6月16日)|Neon 自动化再进一步,逻辑复制冲突日志迎来 v50 更新
数据库·postgresql·自动化
倒流时光三十年2 天前
PostgreSQL 聊一下索引和排序规则
postgresql
睡不醒男孩0308233 天前
PostgreSQL 数据库运维转型:从传统模式到 CLup 平台的 25 个核心 FAQ
运维·数据库·postgresql
JOJO数据科学3 天前
pgAdmin4 Electron 鸿蒙 PC 适配全记录:从白屏到连接 PostgreSQL
postgresql·electron·harmonyos
日取其半万世不竭3 天前
PostgreSQL 跑在 Docker 里怎么备份?恢复成功才算备份成功
数据库·docker·postgresql
倒流时光三十年3 天前
PostgreSQL LEAST 表达式函数详解
数据库·postgresql
Rain5093 天前
2.4. PostgreSQL 数据库连接与实战指南
前端·数据库·人工智能·后端·postgresql·数据分析
倒流时光三十年4 天前
PostgreSQL CASE 条件表达式详解
数据库·postgresql