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)