索引接口汇总整理

## Neo4j

### 索引
- Btree index
- Range index
- Point index
- Lookup index
- FullText index
- Text index

其中Btree为当前默认索引,在neo4j的文档中range index与point index被标记为Future,会在之后的版本中替换Btree index。

### 约束
- Unique property constraints
- Node key constraints
- Node property existence constraints
- Relationship property existence constraints

##### Unique property constraints:
唯一属性约束可确保属性值对于具有特定标签的所有节点是唯一的。对于多个属性的唯一属性约束,属性值的组合是唯一的。唯一约束不要求所有节点都具有所列属性的唯一值 —— 没有所有属性的节点不受此规则的约束。
##### Node property existence constraints:
节点属性存在约束可确保具有特定标签的所有节点都存在一个属性。尝试创建指定标签的新节点但没有此属性的查询将失败。对于尝试删除强制属性的查询也是如此。
##### Relationship property existence constraints:
关系属性存在约束确保属性对于与特定类型的所有关系都存在。尝试创建指定类型的关系但没有此属性的所有查询都将失败。对于尝试删除强制属性的查询也是如此。
##### Node key constraints:
对于给定的标签和属性集合,所有属性都存在于具有该标签的所有节点上且属性值的组合是唯一的。

### 接口
可能涉及的接口有:
| 接口名 | 备注 |
|--------------------------------------------------|----------------------------------------------|
|indexGetForName |根据名称获取index |
|constraintGetForName |根据名称获取constraint |
|index |根据schema查询index |
|indexesGetForLabel |获取与label有关的索引 |
|indexesGetForRelationshipType |根据关系类型获取索引 |
|indexesGetAll |返回所有索引 |
|indexGetState |检索索引状态 |
|indexGetStateNonLocking |检索索引状态(不加锁) |
|indexGetPopulationProgress | |
|~~indexGetFailure~~ | |
|constraintsGetForLabel |查询与label相关的所有约束 |
|constraintsGetForLabelNonLocking |查询与label相关的所有约束(不加锁) |
|constraintsGetForRelationshipType |查询与关系类型相关的所有约束 |
|constraintsGetForRelationshipTypeNonLocking |查询与关系类型相关的所有约束(不加锁) |
|constraintsGetAll |查询所有的约束 |
|constraintsGetAllNonLocking |查询所有的约束(不加锁) |
|-|-|
|indexForSchemaNonTransactional |根据schema查询索引(不要求事务和锁) |
|indexForSchemaAndIndexTypeNonTransactional |根据schema和indexType查询 |
|indexForSchemaNonLocking |根据schema查询索引(不加锁) |
|getLabelIndexesNonLocking |根据label查询索引(不加锁) |
|getRelTypeIndexesNonLocking |根据关系类型查询索引(不加锁) |
|indexesGetAllNonLocking |查询所有索引(不加锁) |
|~~indexUniqueValuesSelectivity~~ | |
|indexSize |检索索引大小 |
|indexSample |检索索引信息 |
|constraintsGetForSchema |根据schema查询约束 |
|constraintsGetForSchemaNonLocking |根据schema查询约束(不加锁) |
|constraintExists |检查约束是否存在 |
|indexGetOwningUniquenessConstraintId | |
|-|-|
|indexProviderByName |根据名称获取indexProvirder |
|indexTypeByProviderName |根据indexProvider获取索引类别 |
|indexCreate |创建索引 |
|indexDrop(indexDescriptor) |删除索引 |
|indexDrop(schema) | |
|indexDrop(name) | |
|uniquePropertyConstraintCreate |创建unique property约束 |
|nodeKeyConstraintCreate |创建node key约束 |
|nodePropertyExistenceConstraintCreate |创建属性存在性约束 |
|relationshipPropertyExistenceConsstraintCreate |创建关系属性存在性约束 |
|constraintDrop(schema, type) |删除约束 |
|constraintDrop(name) | |
|constraintDrop(constraintDescriptor) | |
|-|-|
|indexReadSeesion | |
|tokenReadSession | |
|nodeIndexSeek | |
|nodeIndexScan | |
|lockingNodeUniqueIndexSeek | |
|relationshipIndexSeek | |
|relationshipIndexScan | |

posted @ 2022-10-30 21:36  交响曲  阅读(57)  评论(0编辑  收藏  举报