PostgreSQL查看索引、表对应的relfileno
postgresql索引 查看 对应
2023-09-27 14:28:33 时间
pg_class就相当于oracle中dba_segments+dba_objects的并集。
查看某个文件或索引的relfileno
mydb2=# select relfilenode from pg_catalog.pg_class where relname='idx_my_tb2';
relfilenode
-------------
49307
[zjh@hs-10-20-30-193 data]$ find . -name "49307"
./base/49300/49307
查看某个relfileno对应的对象
例如,查询4930x这批的对象
mydb2=# select * from pg_catalog.pg_class where relfilenode=49302; oid | relname | relnamespace | reltype | reloftype | relowner | relam | relfilenode | relt ablespace | relpages | reltuples | relallvisible | reltoastrelid | relhasindex | relisshared | relpersistence | relkind | relnatts | relchecks | relhasrules | relhastriggers | relhassubc lass | relrowsecurity | relforcerowsecurity | relispopulated | relreplident | relispartition | relrewrite | relfrozenxid | relminmxid | relacl | reloptions | relpartbound -------+---------+--------------+---------+-----------+----------+-------+-------------+----- ----------+----------+-----------+---------------+---------------+-------------+------------- +----------------+---------+----------+-----------+-------------+----------------+----------- -----+----------------+---------------------+----------------+--------------+---------------- +------------+--------------+------------+--------+------------+-------------- 49302 | my_tb2 | 2200 | 49304 | 0 | 10 | 2 | 49302 | 0 | 0 | 0 | 0 | 0 | t | f | p | r | 2 | 0 | f | f | f | f | f | t | d | f | 0 | 587 | 1 | | | (1 row)
可知是对象my_tb2,类型定义在pg_type中,可以参见https://www.cnblogs.com/orangeform/archive/2012/05/25/2305415.html。
相关文章
- Greenplum 空间(GIS)数据检索 B-Tree & GiST 索引实践 - 阿里云HybridDB for PostgreSQL最佳实践
- CentOS 6.7 下 PostgreSQL 9.5 的安装与配置
- [转]PostgreSQL教程(十六):系统视图详解
- 使用PostgreSQL遇到的一个问题[column does not exist]字段不存在:
- PostgreSQL配置密码复杂度策略
- PostgreSQL 通过归档日志定期增量同步数据
- 如何在PostgreSQL中建只读账号
- PostgreSQL 日常SQL记录
- JAVA Postgresql 根据model类自动生成插入语句,批量插入数据
- PostgreSQL 数据库错误状态编号解释[附带列表
- AliSQL 20171010版本发布 Sequence兼容PostgreSQL/Oracle语法和升级TLSv1.2
- spring mvc 链接 postgresql
- HTAP数据库 PostgreSQL 场景与性能测试之 29 - (OLTP) 高并发空间位置更新(含空间索引)
- lightdb/postgresql中的统计信息详解
- postgresql/lightdb的 is distinct from、is not distinct from
- lightdb/postgresql中的MemoryContext out of memory原因分析及解决思路
- postgresql unnamed statement
- postgresql/lightdb查询优化之GIN(Generalized Inverted Index)索引与全文检索