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

影响:

相关推荐
Rain5091 小时前
2.4. PostgreSQL 数据库连接与实战指南
前端·数据库·人工智能·后端·postgresql·数据分析
倒流时光三十年17 小时前
PostgreSQL CASE 条件表达式详解
数据库·postgresql
倒流时光三十年18 小时前
PostgreSQL COALESCE 条件表达式函数详解
数据库·postgresql
雁無痕20 小时前
Postgresql启动无监听端口问题的解决
postgresql
倒流时光三十年1 天前
PostgreSQL NULLIF 条件表达式函数详解
数据库·sql·postgresql
倒流时光三十年1 天前
PostgreSQL VALUES 列表详解
数据库·postgresql
倒流时光三十年1 天前
PostgreSQL GREATEST 条件表达式函数详解
服务器·数据库·postgresql
agilearchitect3 天前
asyncpg:专为 asyncio 打造的 PostgreSQL 驱动
数据库·其他·postgresql
IvorySQL3 天前
PostgreSQL 技术日报 (6月10日)|多工具版本更新,PG19 图语法落地
数据库·postgresql
IvorySQL3 天前
PostgreSQL 全球对话:开源链接世界,共建共治共享
数据库·postgresql·开源