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)
 索引

建立索引it

create index on :User(id)sse

删除索引co

drop index on :User(id)block

惟一性约束index

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

删除惟一性约束系统

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

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

 

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

 

系统自动使用索引的场景

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)

相关文章
相关标签/搜索