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

影响:

相关推荐
AI人工智能集结号6 小时前
AI回答采集:基于PostgreSQL JSONB的原始数据存储与可追溯性方案
数据库·人工智能·postgresql
IvorySQL7 小时前
PG 日报|查询优化器重大修复,支持更多复杂 SQL 优化
数据库·人工智能·postgresql·开源
倒流时光三十年10 小时前
第一阶段 01.Elasticsearch 核心概念与 PostgreSQL 对照
大数据·elasticsearch·postgresql
SelectDB技术团队11 小时前
PostgreSQL 实时同步至 Apache Doris / SelectDB:内置 CDC 能力、选型对比与实践
数据库·postgresql·apache doris·selectdb
777VG2 天前
PostgreSQL +martin将多张表输出成一个 MVT
前端·数据库·postgresql
IvorySQL2 天前
PG 日报|优化缓冲区批量扫描,降低多套接字并发竞争
数据库·人工智能·postgresql·开源·区块链
muddjsv2 天前
SQLite与MySQL/PostgreSQL本质区别:运行模型、并发、部署、权限全方位对比
mysql·postgresql·sqlite
pxzsky3 天前
PG17数据库安装中分分词插件:pg_jieba
数据库·postgresql·pg_jieba
jun_bai3 天前
postgresql数据库免安装版安装到windows系统
数据库·postgresql
BullSmall3 天前
CentOS7 阿里云 PG 镜像 PG10.9 → PG17 完整升级指南
阿里云·postgresql·centos