pageinspect介绍

简介: pageinspect介绍

1.查看普通页面信息
get_raw_page(relname text, fork text, blkno int) returns bytea 得到一个页面的内容;
select * from page_header(get_raw_page('test',0))得到0号页面的头部信息;
select * from heap_page_items(get_raw_page('test',0))得到0号页面具体item信息。
image
lp表示line point;
lp_off是tuple在page中的相对位置;
t_xmin,t_xmax都与事务有关;
t_ctid就是表示这个LINE POINT指向的位置。

2.查看索引页面信息
bt_metap('索引')
image
这个信息表示索引有2级,root节点页面是412。

bt_page_stats('索引',页面号)
image
btpo_flags=2表示root节点,btpo_flags=1表示 leaf节点,btpo_flags=0表示 branch节点,btpo_flags=3表示即使root节点又是leaf节点。btpo=2表示不是最底层(btpo=0是最底层),btpo_prev和btpo_next表示左右节点页面号。

bt_page_items('索引',)
image
只要是最右节点第一条代表起始item,这个是root页面也是最右页面起始item(3,1)

目录
相关文章
|
XML 数据格式
|
供应链 机器人
什么是RPA?
什么是RPA?
416 0
|
算法
PAT条条大路通罗马
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness.
135 0
|
Web App开发
XPathHelper使用
XPathHelper使用
138 0
|
JavaScript 前端开发