incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

各种索引原理是什么?

Open youngkangrui opened this issue 6 years ago • 2 comments

想深入了解下hugeGraph索引建立的原理,有相关资料推荐吗

youngkangrui avatar Mar 06 '20 02:03 youngkangrui

@youngkangrui hugegraph database index支持已经比较全面,图数据库的索引一般包括几方面:

  • 图索引/边索引:主要用于加速获取顶点的关联边,一般使用邻接表或十字链表等方式,也可以使用hash索引。hugegraph使用的是邻接表。

  • 超级点索引:主要用于加速获取超级顶点的部分关联边,比如查询12315号码这个点最近一周的通话边。hugegraph通过sortkey实现的,相当于增强版邻接表。

  • 普通属性索引(secondary-index):主要用于加速根据属性来检索顶点、或根据属性来检索边,数据库一般使用btree或hash实现。

  • 可比较大小来检索的属性索引(range-index):主要用于加速根据属性范围来检索顶点或边,比如age>18的人,数据库一般使用btree实现。

  • 可根据前缀+比较大小来检索的属性索引(shard-index):主要用于加速根据属性范围来检索顶点或边,比如city=Beijing && age>18的人。

  • 可全文检索的属性索引(search-index):主要用于加速根据属性值中的任意文本段或词语来检索顶点或边,比如city contains Bay的人。

属性索引在hugegraph实现根据存储而定,主要还是依赖lsm-tree;全文索引的实现原理是对属性文本分词后进行存储索引。

参考文档:2.5 IndexLabel

javeme avatar Mar 06 '20 09:03 javeme

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

github-actions[bot] avatar Sep 04 '21 21:09 github-actions[bot]