当前位置:   article > 正文

Cypher - 索引

cypher 添加索引

1. 在等式中使用索引            例:  u.id = 1
2. 在不等式中使用索引         例:  u.id > 1
3.在 in 中使用索引               例:  u.id in [1,2,3]
4.在 starts with 中使用索引  例:  u.name starts with 'abs'
5.在存在性时使用索引          例:  exists(u.id)
 

创建索引

create index on :User(id)

删除索引

drop index on :User(id)

唯一性约束

create constraint on (u:User) assert u.id is unique

删除唯一性约束

drop constraint on (u:User) assert u.id is unique

属性存在性约束 - 企业版功能

 

关系属性存在性约束 - 企业版功能

 

系统自动使用索引的场景

1. 等式使用索引  user.name = 'aa'

2. 范围比较使用索引 user.name >'a'

3. in 中使用索引  user.id in [1,2]

4. starts with 使用索引   user.name starts with 'a'

5. 检查属性存在时使用   exists(user.name)

 

 

 

 

 

 

 

 

转载于:https://my.oschina.net/u/2552286/blog/3070330

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/秋刀鱼在做梦/article/detail/1013628
推荐阅读
相关标签
  

闽ICP备14008679号