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

影响:

相关推荐
文牧之11 小时前
PostgreSQL的扩展 amcheck
运维·数据库·postgresql
静思心远18 小时前
ubuntu2x.xx网络不通如何解决
网络·数据库·postgresql
在未来等你2 天前
高级SQL技巧:PostgreSQL高级特性实战指南
sql·postgresql·性能优化·窗口函数·递归查询
Mr.朱鹏3 天前
SQL实战之索引失效案例详解
java·数据库·spring boot·sql·mysql·spring·postgresql
数巨小码人4 天前
PostgreSQL中的权限管理简介
数据库·postgresql
rosemary5124 天前
Ubuntu 20.04 postgresql
linux·ubuntu·postgresql
运维老曾4 天前
PostgreSQL 用户权限与安全管理
数据库·postgresql
伊织code4 天前
macOS 安装 PostgreSQL
数据库·macos·postgresql·gui·安装·客户端·psql
运维老曾5 天前
PostgreSQL 软件升级
数据库·postgresql
运维老曾5 天前
在ubuntu 24安装 postgresql 17 (源码安装)
linux·ubuntu·postgresql