在 SQL Server 中,您可以使用该DBCC PAGE
命令检查特定的索引信息。postgres中有类似的东西吗?
如果没有,那么您将如何获得相同的信息?这只是出于研究目的。
此命令返回:
Page @0x00000004ED67A000
m_pageId = (1:299) m_headerVersion = 1 m_type = 1
m_typeFlagBits = 0x0 m_level = 0 m_flagBits = 0x4
m_objId (AllocUnitId.idObj) = 121 m_indexId (AllocUnitId.idInd) = 256
Metadata: AllocUnitId = 72057594045857792
Metadata: PartitionId = 72057594040614912 Metadata: IndexId = 1
Metadata: ObjectId = 99 m_prevPage = (1:297) m_nextPage = (1:300)
pminlen = 4008 m_slotCnt = 2 m_freeCnt = 70
m_freeData = 8118 m_reservedCnt = 0 m_lsn = (35:184:44)
m_xactReserved = 0 m_xdesId = (0:0) m_ghostRecCnt = 0
m_tornBits = 0 DB Frag ID = 1
Allocation Status
GAM (1:2) = ALLOCATED SGAM (1:3) = ALLOCATED
PFS (1:1) = 0x60 MIXED_EXT ALLOCATED 0_PCT_FULL DIFF (1:6) = CHANGED
ML (1:7) = NOT MIN_LOGGED
Slot 0 Offset 0x60 Length 4011
你可以
然后就可以使用函数了
获取有关索引第 42 块的一些信息:活动和死条目的数量、可用空间的数量以及指向左右兄弟(
btpo_prev
和btpo_next
)的指针以及类型(r
oot、i
ntermediate 或l
eaf)。