状态查询函数
index_inspect(regclass,partition)
描述: 查询索引内部数据构成信息。支持的索引类型包括:Graph_Index(HNSW)、fulltext、DiskANN。
说明
该函数自V3.0.0.1版本开始支持。
参数说明: 输入索引名。
如果需要定位分区表中具体的索引信息,可以使用如下语句查询某一个具体分区索引的信息。
SELECT * FROM INDEX_INSPECT('<index_name>', '<index_partition_name>');
--或者
SELECT * FROM INDEX_INSPECT('<index_name>', '<index_partition_oid>');
其中,索引名<index_name>可替换为<index_oid>,即index_inspect(oid,partition)。索引分区名(或者OID)可以通过PG_PARTITION系统表获取。
返回值类型: SETOF record
输出的结果集包含两列,分别是attribute(text类型),表示信息属性;content(text类型),表示属性对应的数值。属性列表参考如下:
Graph_Index索引输出内容:
| attribute 属性 | 说明 |
|---|---|
| Used Space | 索引占用磁盘空间,content 格式为xxx GB/MB/KB,精确到小数点后三位。 |
| Required Space | 索引所存储数据二进制格式下所需要的最小空间,格式同上。 |
| Space Utilization Rate | Used Space 和 Required Space 比重,以百分号的格式表示。 |
| Available Slot# | 索引中可以插入新数据的空闲位置数量,实际是否可以复用需由 VACUUM 状态确定。 |
| Total Points | 图索引点数量。 |
| Total Elements | 包含向量数据数量。 |
| Total Neighbors | 图索引领边关系数量。 |
| Number of elements reaching level [0,1,2,...] | 多层图索引中第 N 层的点数量,如该层图为空则不打印。 |
| Average Number of Bottom Neighbors | 底层图中各点的邻边关系数量平均值。 |
| Standard Deviation of Bottom Neighbors | 底层图中各点的邻边关系数量标准差。 |
| Percentile [1,5,10,25,50,75,90,95,99]% of Bottom Neighbors Count | 底层图中各点的邻边关系数量百分位数。 |
fulltext索引输出内容:
| attribute 属性 | 说明 |
|---|---|
| Used Space | 索引占用磁盘空间,content 格式为 xxx GB/MB/KB,精确到小数点后三位。 |
| Required Space | 索引所存储数据二进制格式下所需要的最小空间,格式同上。 |
| Space Utilization Rate | Used Space 和 Required Space 比重,以百分号的格式表示。 |
| Number of documents | 文档数量。 |
| Number of distinct tokens | 单词数量(不包含重复单词)。 |
| Attribute [attr name]: average doc length | 属性列 [attr name] 的文档平均长度。 |
| Attribute [attr name]: number of short-length tokens | 属性列 [attr name] 的短词个数(长度小于7,中文单字长度为3)。 |
| Attribute [attr name]: number of mid-length tokens | 属性列 [attr name] 中等长度词个数(长度小于13)。 |
| Attribute [attr name]: number of long-length tokens | 属性列 [attr name] 的长词个数(长度小于49)。 |
| Attribute [attr name]: number of full tokens | 属性列 [attr name] 的超长词个数(长度大于等于49)。 |
| Document Store Used Size | 文档信息存储占用磁盘空间。 |
| Document Store Required Size | 文档信息所存储数据二进制格式下所需要的最小空间。 |
| Token Store Used Size | 单词信息存储占用磁盘空间。 |
| Token Store Required Size | 单词信息所存储数据二进制格式下所需要的最小空间。 |
| Short Inverted List Type [0,1,2] Used Size | 短类型 X 倒排索引存储占用磁盘空间。 |
| Short Inverted List Type [0,1,2] Required Size | 短类型 X 倒排索引所存储数据二进制格式下所需要的最小空间。 |
| Short Inverted List Type [0,1,2] Number of Entries | 短类型 X 倒排索引存储内容个数。 |
| Short Inverted List Type [0,1,2] Reserved Number of Entries | 短类型 X 倒排索引可以插入新数据的空闲位置数量。 |
| Inverted List Used Size Total | 倒排索引总存储占用磁盘空间。 |
| Inverted List Required Size Total | 倒排索引总存储数据在二进制格式下所需要的最小空间。 倒排索引短类型0: 单词词频小于等于4; 倒排索引短类型1: 单词词频小于等于32; 倒排索引短类型2: 单词词频小于等于162。 |
DiskANN索引输出内容:
| attribute 属性 | 说明 |
|---|---|
| Used Space | 索引占用磁盘空间,content 格式为 xxx GB/MB/KB,精确到小数点后三位。 |
| Required Space | 索引所存储数据二进制格式下所需要的最小空间,格式同上。 |
| Space Utilization Rate | Used Space 和 Required Space 比重,以百分号的格式表示。 |
| Total Points | 图索引点数量(等同于包含的向量数据数量)。 |
| Reserved Slot | 索引中可以插入新数据的空闲位置数量。 |
| Total Neighbors | 图索引领边关系数量。 |
| Average Number of Neighbors | 图中各点的邻边关系数量平均值。 |
| Standard Deviation for Numer of Neighbors | 图中各点的邻边关系数量标准差。 |
| Percentile [1,5,10,25,50,75,90,95,99]% of Neighbors Count | 图中各点的邻边关系数量百分位数。 索引为空时部分输出会省略。 |
index_inspect(oid,partition)
描述: 作用同index_inspect(regclass,partition),只是将函数入参替换为索引对象的oid。
说明
该函数自V3.0.0.1版本开始支持。
说明