首页 > 数据库 >postgresql数据预热

postgresql数据预热

时间:2023-05-07 22:47:19浏览次数:41  
标签:预热 1.0 kdb sys catalog prewarm pg postgresql 数据

test=# select * from pg_available_extensions where name like '%prewarm%' order by name;
name | default_version | installed_version | comment
-------------+-----------------+-------------------+-----------------------
sys_prewarm | 1.2 | | prewarm relation data
(1 row)

test=# \dx
List of installed extensions
Name | Version | Schema | Description
---------------------+---------+--------------+---------------------------------------------------------------------------------------------------------------------
dbms_ddl | 1.0 | sys | DBMS_DDL system package
dbms_output | 1.0 | sys | DBMS_OUTPUT system package
dbms_utility | 1.0 | sys | dbms_utility extension package
kdb_cast | 1.0 | sys | kdb_cast extension
kdb_license | 1.0 | pg_catalog | kdb_license extension
kdb_oracle_datatype | 1.5 | sys | kdb_oracle_datatype extension
kdb_tinyint | 1.0 | pg_catalog | Create a new data type tinyint and its functions operators and indexes
kingbase_version | 1.0 | pg_catalog | This is a utility that provides function related to version number, it is used to get the Kingbase version number.
owa_util | 1.0 | sys | owa_util system package
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
plsql | 1.0 | pg_catalog | PL/SQL procedural language
src_restrict | 1.0 | src_restrict | src restrict plugin
sys_anon | 1.0 | anon | provides data masking functionality
sys_buffercache | 1.3 | public | examine the shared buffer cache
sys_freespacemap | 1.2 | sys | examine the free space map (FSM)
sys_hint_plan | 1.3.5 | hint_plan |
sys_kwr | 1.5 | public | KingbaseES auto workload repository and report builder
sys_stat_statements | 1.10 | public | track parsing, planning and execution statistics of all SQL statements executed
sysaudit | 1.0 | sysaudit | provides auditing functionality
sysmac | 1.0 | sysmac | Mac for Kingbase
xlog_record_read | 1.0 | pg_catalog | xlog_record_read functions
(21 rows)

test=# CREATE EXTENSION sys_prewarm;
CREATE EXTENSION
test=# \dx
List of installed extensions
Name | Version | Schema | Description
---------------------+---------+--------------+---------------------------------------------------------------------------------------------------------------------
dbms_ddl | 1.0 | sys | DBMS_DDL system package
dbms_output | 1.0 | sys | DBMS_OUTPUT system package
dbms_utility | 1.0 | sys | dbms_utility extension package
kdb_cast | 1.0 | sys | kdb_cast extension
kdb_license | 1.0 | pg_catalog | kdb_license extension
kdb_oracle_datatype | 1.5 | sys | kdb_oracle_datatype extension
kdb_tinyint | 1.0 | pg_catalog | Create a new data type tinyint and its functions operators and indexes
kingbase_version | 1.0 | pg_catalog | This is a utility that provides function related to version number, it is used to get the Kingbase version number.
owa_util | 1.0 | sys | owa_util system package
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
plsql | 1.0 | pg_catalog | PL/SQL procedural language
src_restrict | 1.0 | src_restrict | src restrict plugin
sys_anon | 1.0 | anon | provides data masking functionality
sys_buffercache | 1.3 | public | examine the shared buffer cache
sys_freespacemap | 1.2 | sys | examine the free space map (FSM)
sys_hint_plan | 1.3.5 | hint_plan |
sys_kwr | 1.5 | public | KingbaseES auto workload repository and report builder
sys_prewarm | 1.2 | public | prewarm relation data
sys_stat_statements | 1.10 | public | track parsing, planning and execution statistics of all SQL statements executed
sysaudit | 1.0 | sysaudit | provides auditing functionality
sysmac | 1.0 | sysmac | Mac for Kingbase
xlog_record_read | 1.0 | pg_catalog | xlog_record_read functions
(22 rows)

test=# \dx+ sys_prewarm
Objects in extension "sys_prewarm"
Object description
--------------------------------------------------------
function autoprewarm_dump_now()
function autoprewarm_start_worker()
function sys_extend(regclass,bigint)
function sys_prewarm(regclass,text,text,bigint,bigint)
(4 rows)

test=# \sf+ sys_prewarm
CREATE OR REPLACE FUNCTION public.sys_prewarm(regclass, mode text DEFAULT 'buffer'::text, fork text DEFAULT 'main'::text, first_block bigint DEFAULT NULL::bigint, last_block bigint DEFAULT NULL::bigint)
RETURNS bigint
LANGUAGE c
PARALLEL SAFE
1 AS '$libdir/sys_prewarm', $function$sys_prewarm$function$

select pg_size_pretty(pg_total_relation_size('pgbench_accounts'));

--加载数据从硬盘加载到内存

select pg_prewarm(test);

--查看是否缓存
select count(*) from sys_buffercache where relfilenode = (select relfilenode from pg_class where relname = 't');

--需要缓存对象

 

标签:预热,1.0,kdb,sys,catalog,prewarm,pg,postgresql,数据
From: https://www.cnblogs.com/omsql/p/17380344.html

相关文章

  • shp数据插入sde连接的PostgreSQL库(二)---利用GeoTools读取shp数据并插入到空间数据库
    前言 上一篇介绍了如何利用Maven构建GeoTools,这一节将介绍下一步内容,如何读取shp文件里面的信息并插入到SDE连接的PostgresSQL现有表中。背景 从搭建环境到实现上述功能,大概用了7个工作日,从4月25日开始的,中间有个五一假期。公司的后端都不愿意接这活,只能自己上了。......
  • Json数据的序列化与反序列化的三种常用方法介绍
    以下内容是本作者从官网中看相应的教程后所做的demo,其体现了作者对相关知识点的个人理解。。作者才疏学浅,难免会有理解不到位的地方。。还请各位读者批判性对待。。。    本文主要介绍在Json数据的序列化与反序列化的过程中我经常用到的三种工具的基本使用方法,及其他们之间......
  • Vue.js:Vue-Router动态路由从服务器接口获取路由数据
    (目录)文档https://v3.router.vuejs.org/zh/installation.html版本号"vue":"2.6.10","vue-router":"3.6.5",有几种方式实现动态路由:前端配置完整路由,通过接口返回的数据判断是否可显示,是否可访问前端配置部分路由,由后端接口返回的数据生成新路由抛开路由的思维,是否......
  • 【pandas基础】--核心数据结构
    pandas中用来承载数据的两个最重要的结构分别是:Series:相当于增强版的一维数组DataFrame:相当于增强版的二维数组pandas最大的优势在于处理表格类数据,如果数据维度超过二维,一般我们会使用另一个python的库numpy。本篇主要介绍这两种核心数据结构的创建方式。1.Seriespand......
  • 第2章-数据的表示和运算
    2.3浮点数的表示和运算1.浮点数尾数的表示1.阶码(E):反映数值大小;反映浮点数的表示范围及小数点的实际位置;常用补码或移码表示的定点整数;2.尾数(M):反映精度;常用原码或补码表示的定点小数浮点数的真值:N=R^E×M,阶码的底(称为基数)R通常为2例:若阶码和尾数均用补码表示,求a,b的真......
  • 【大数据】Hive Join 的原理与机制
    目录一、概述二、环境准备三、HiveJOIN类型四、Map,Shuffle,Reduce三阶段1)Map阶段2)Shuffle阶段3)Reduce阶段五、CommonJoin(Reduce阶段)六、MapJoin(Map阶段)一、概述Hive是一个基于Hadoop的数据仓库解决方案,它提供了类似于SQL的查询语言,称为HiveQL,用于处理结构化数据。在Hive中......
  • 存储双活同步导致数据库异常恢复---惜分飞
    联系:手机/微信(+8617813235971)QQ(107644445)标题:存储双活同步导致数据库异常恢复作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]客户双活存储异常之后,单个存储运行,故障存储修复之后,双活同步,出现多套系统异常,上一篇:Controlf......
  • 数据类型及常用方法
    引入我们学习变量是为了让计算机能够像人一样去记忆事物的某种状态,而变量的值就是用来存储事物状态的,很明显事物的状态分成不同种类的(比如人的年龄,身高,职位,工资等等),所以变量值也应该有不同的类型,例如salary=3.1#用浮点型去记录薪资age=18#用整型去记录年龄name='lil......
  • 数据库查询速度优化之解决技巧
    1、对查询进行优化,应尽可能避免全表扫描首先应考虑在where及orderby涉及的列上建立索引。 下面我们来以一个表中177条数据比较一下,全表扫描与建立索引之后性能的一个比较.1.1全表查询1.2建立索引查询1.3结论从这两种方式查询数据库结果看,建立索引之后查询速度提高了些......
  • (数据科学学习手札152)geopandas 0.13版本更新内容一览
    本文示例代码已上传至我的Github仓库https://github.com/CNFeffery/DataScienceStudyNotes1简介大家好我是费老师,昨天晚上geopandas正式发布了其0.13.0版本,距离其上一个版本更新已经过去了5个多月,在这一次更新中除了日常的bug修复以外,还为我们带来了多项新功能,今天的文章......