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

影响:

相关推荐
l1t13 小时前
DeepSeek总结的从 Crunchy PGO 迁移到使用 CloudNativePG 管理的 PostgreSQL 18
数据库·postgresql
阳光九叶草LXGZXJ17 小时前
自制数据库迁移工具-C版-07-HappySunshineV1.6-(支持PG、达梦、Gbase8a)
linux·c语言·开发语言·数据库·学习·postgresql
审判长烧鸡19 小时前
【Go 时间类型】 int64/time.Time的选择
postgresql·go·time.time
阿洛学长1 天前
PostgreSQL 超详细安装与使用教程:从入门到实战
数据库·postgresql
音符犹如代码2 天前
Docker 一键部署带有 TimescaleDB 插件的 PostgreSQL
java·运维·数据库·后端·docker·postgresql·容器
CCPC不拿奖不改名2 天前
PostgreSQL数据库部署linux服务器流程
linux·服务器·数据库·windows·python·docker·postgresql
mpHH2 天前
postgresql-分区表
数据库·postgresql
l1t3 天前
在WSL的ubuntu 26.04容器中用deb安装包安装使用redrock-4.1-1
linux·运维·ubuntu·postgresql
Hehuyi_In3 天前
postgres-howto 学习笔记
笔记·学习·postgresql·脚本·how to
Mike117.3 天前
GBase 8c 里 search_path 没管住,SQL 可能跑到另一个对象上
数据库·sql·postgresql