InfluxDB数据读取流程

本文详细介绍了InfluxDB数据读取流程,重点关注indirectIndex结构体,包括offsets、minKey、maxKey、minTime、maxTime和tombstones字段。在查询过程中,InfluxDB先进行tag过滤,然后通过SeriesID获取SeriesKey,结合fieldKey形成Key,利用indirectIndex进行二分搜索找到IndexBlock,再进行时间过滤和field条件过滤,最后从DataBlock中读取满足条件的数据。
摘要由CSDN通过智能技术生成

InfluxDB数据读取流程

indirectIndex结构体

 在讲解InfluxDB数据读取流程之前,首先来看一下InfluxDB中一个中要的结构体struct indirectIndex,这样有助于我们了解后续数据读取以及删除的整个流程,indirectIndex相当于TSM文件的index,通过indirectIndex来查找TSM中的IndexBlock

// indirectIndex is a TSMIndex that uses a raw byte slice representation of an index.  This
// implementation can be used for indexes that may be MMAPed into memory.
type indirectIndex struct {
	mu sync.RWMutex
	// b is the underlying index byte slice.  This could be a copy on the heap or an MMAP
	// slice reference
	b []byte

	// offsets contains the positions in b for each key.  It points to the 2 byte length of
	// key.
	offsets []byte

	// minKey, maxKey are the minium and maximum (lexicographically sorted) contained in the
	// file
	minKey, maxKey []byte

	// minTime, maxTime are the minimum and maximum times contained in the file across all
	// series.
	minTime, ma
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值