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

影响:

相关推荐
利威尔xu2 天前
PostgreSQL 索引失效 4 类:函数运算让查询全表扫描拖垮性能
开发语言·数据库·postgresql·性能优化·索引优化
Lucifer三思而后行2 天前
PostgreSQL DBA 面试必问的 30 个问题,建议收藏!
postgresql·dba
tianyuanwo3 天前
PostgreSQL 部署运维实战总结:从安装踩坑到生产可用
运维·数据库·postgresql
打工的小王4 天前
postgresql和mysql对比
数据库·mysql·postgresql
tianyuanwo4 天前
NocoDB 系统手册:PostgreSQL 主机资产管理的界面层实施方案
数据库·postgresql·oracle
ClouGence8 天前
最基础的异构数据库 DDL 同步,我们踩过哪些坑?
数据库·mysql·postgresql
数据库小学妹9 天前
pgbouncer 事务池:prepared statement、临时表与会话状态
数据库·后端·postgresql
zhangjw349 天前
1-9 SELECT 查询基础:where、group by、having、order by、limit offset
数据库·postgresql·pg数据库
FungLeo11 天前
成为全栈·基础补充·数据库迁移与事务:数据结构怎样安全演进
mysql·postgresql·sqlite·数据一致性·数据库事务·数据库迁移·成为全栈
隔窗听雨眠12 天前
云数仓向PostgreSQL生态延伸的技术动因与工程代价
postgresql·数据库架构·云数仓