incubator-hugegraph
incubator-hugegraph copied to clipboard
请问有没有提供批量删除顶点的api
Expected behavior 期望表现
{type something here...}
Actual behavior 实际表现
{type something here...}
Steps to reproduce the problem 复现步骤
- {step 1}
- {step 2}
- {step 3}
Status of loaded data 数据状态
Vertex/Edge summary 数据量
- loaded vertices amount: {like 10 million}
- loaded edges amount: {like 20 million}
- loaded time: {like 200s}
Vertex/Edge example 数据示例
{type something here...}
Schema(VertexLabel, EdgeLabel, IndexLabel) 元数据结构
{type something here...}
Specifications of environment 环境信息
- hugegraph version: {like v0.7.4}
- operating system: {like centos 7.4, 32 CPUs, 64G RAM}
- hugegraph backend: {like cassandra 3.10, cluster with 20 nodes, 3 x 1TB HDD disk each node}
多谢反馈,目前没有批量删除顶点的API,后续我们会考虑加入这个特性。你希望使用这个API是出于性能的考虑还是业务场景中有类似的需求呢?
@luobairan 如果删除量不是太大的话(一次删除少于1000条记录),可以使用Gremlin Drop语句
同需求,几亿数据删好几天
新的 0.11-b3 补丁包 可以大幅度提升删除速度,并且如果是用REST API,建议通过同时提供 label+id 两个参数的方式删除。
gremlin的删除示例:
count = 0
def all = hugegraph.traversal().V().hasLabel("xxx").limit(10000)
while(all.hasNext()) {
while(all.hasNext()) {
all.next().remove()
if (++count >= 500) {
g.tx().commit()
count = 0
}
}
g.tx().commit()
all = hugegraph.traversal().V().has("xxx").limit(10000)
}
!all.hasNext()
也可进一步参考:https://github.com/hugegraph/hugegraph/issues/1298
利用REST API删除顶点/边时,建议通过同时提供 label+id 两个参数的方式删除,形如:delete /path/to/{id}?label=xx