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

影响:

相关推荐
DarkAthena3 小时前
频繁 DROP/CREATE TABLE 在 PostgreSQL 中的问题及解决思路
postgresql
鱼听禅5 小时前
CentOS搭建SVN服务器
数据库·postgresql·sqlserver
king_harry1 天前
Oracle DG4ODBC + PostgreSQL ODBC 驱动 + DBLINK 实现oracel访问postgresql
postgresql·oracle·异构数据库访问·dg4odbc
不甘先生1 天前
PostgreSQL 数据库基础一览表
数据库·postgresql
人生苦短1281 天前
CentOS 7.9 部署 PostgreSQL 15.17 + PostGIS 3.4.8 操作文档
linux·postgresql·centos
曲幽2 天前
我用了FastApiAdmin后,连夜把踩过的坑都整理出来了
redis·python·postgresql·vue3·fastapi·web·sqlalchemy·admin·fastapiadmin
Muscleheng2 天前
Navicat连接postgresql时出现‘datlastsysoid does not exist‘报错
数据库·postgresql
Gauss松鼠会2 天前
GaussDB(DWS) 日常维护命令
服务器·数据库·postgresql·性能优化·gaussdb·经验总结
IvorySQL2 天前
开源共建分论坛圆桌讨论:如何真正融入 PostgreSQL 社区?
postgresql·开源·区块链
l1t2 天前
DeepSeek总结的postgresql 数据分析师 vs width_bucket()
数据库·postgresql