使用部分主键改进 KUDU 中的搜索

Using parts of the primary key to improve searching in KUDU

我有一个由三列(id_grandparent、id_parent、id_row)组成的主键,它驻留在 KUDU 中。

我希望通过 id_grandparent 查找时我的查找速度更快(类似于 hbase)。我正在使用 Impala 和 Spark 进行查找,假设它们都对相等性进行谓词下推。

我有一些问题无法通过阅读文档 100% 确定

SELECT * FROM my_table where id_grandparent = 55

即使我不提供整个主键,此查询也能使用索引顺序吗? (又名 return 超级快)。我假设是,因为我猜主键是按第一列排序的,它是某种前缀扫描

SELECT * FROM my_table where id_parent = 55

这个查询可以使用任何类型的优化吗?或者任何非第一列(如果未提供第一列)将强制对所有平板电脑进行全面扫描。

我在这里读到过:https://kudu.apache.org/2018/09/26/index-skip-scan-optimization-in-kudu.html 但我不确定它是否已发布

谢谢!

根据 this JIRA ticket,它仍在等待中。

根据this documentation(在回答这个问题时最新的)

Scans on multilevel partitioned tables can take advantage of partition pruning on any of the levels independently.

但是我怀疑索引跳过扫描是否已经实现,考虑到 blog post 是几个月前才写的。

更新 根据dev@kudu.apache.org

的回复

Unfortunately the original author's internship ended last summer and nobody has taken the time to complete the work. It would definitely speed up certain types of queries. There are some concerns that in its current state it could cause a performance regression for some queries though. It could probably benefit from improvements to the heuristics it uses to decide when to enable the skip scan optimization.