Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vid-par #68

Merged
merged 7 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/manual-CN/1.overview/1.concepts/1.data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ G = < V, E, P<sub>V</sub>, P<sub>E</sub> >,

## 节点
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

节点用于表示现实世界中的实体本例的数据中共包含 11 个节点。
节点用于表示现实世界中的实体。在 **Nebula Graph** 中,节点是用节点标识符(即 `VID`)标识的。每个图空间中的 `VID` 必须是唯一的。本例的数据中共包含 11 个节点。
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

<img src="https://user-images.githubusercontent.com/42762957/64932628-00eecf00-d873-11e9-844b-6b2a535ca734.png" width="15%" height="20%">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

```ngql
INSERT VERTEX <tag_name> [, <tag_name>, ...] (prop_name_list[, prop_name_list])
{VALUES | VALUE} vid: (prop_value_list[, prop_value_list])
{VALUES | VALUE} VID: (prop_value_list[, prop_value_list])

prop_name_list:
[prop_name [, prop_name] ...]
Expand All @@ -15,7 +15,7 @@ INSERT VERTEX 可向 **Nebula Graph** 插入节点。

- `tag_name` 表示标签(节点类型),在进行 `INSERT VERTEX` 操作前需创建好。
- `prop_name_list` 指定标签的属性列表。
- `vid` 表示点 ID目前的排序依据为“二进制编码顺序“:即 0, 1, 2, ... 9223372036854775807, -9223372036854775808, -9223372036854775807, ..., -1。`vid` 支持手动指定 ID 或使用 hash 生成。
- `VID` 表示点 ID。每个图空间中的 `VID` 必须是唯一的。目前的排序依据为“二进制编码顺序“:即 0, 1, 2, ... 9223372036854775807, -9223372036854775808, -9223372036854775807, ..., -1。`VID` 支持手动指定 ID 或使用 hash 生成。
amber-moe marked this conversation as resolved.
Show resolved Hide resolved
amber-moe marked this conversation as resolved.
Show resolved Hide resolved
- `prop_value_list` 须根据 `prop_name_list` 列出属性,如无匹配类型,则返回错误。
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

## 示例
Expand Down
11 changes: 11 additions & 0 deletions docs/manual-CN/5.appendix/vid-partition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 点 ID 和分区
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

本文档提供有关节点标识符(简称 `VID`)和分区的一些介绍。

在 **Nebula Graph** 中,节点是用节点标识符(即 `VID`)标识的。插入节点时,可以手动分配 ID 或使用哈希函数为节点生成 ID。 `VID` 在图空间中必须唯一。
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

在 **Nebula Graph** 群集中进行查询时,如果将数据分到不同的分区,且这些分区驻留在多个节点上,则必须在不同的群集节点之间交换数据。此时图遍历通常在协调器上执行,因为此时遍历需要全局信息。这会消耗大量的网络流量,并减慢查询执行速度。
amber-moe marked this conversation as resolved.
Show resolved Hide resolved

如果希望在集群中的查询像单机查询那样迅速,就需要基于标签对节点进行分片,以便将具有相同标签的节点存储在同一分区中。这样可以改善数据局部性并减少群集节点之间的网络开销。

如果要将具有相同标签的所有节点都存储在同一分区上,则需要确保所有节点的 `VID` 具有相同的模数。与这些节点相关联的所有边也都存储在此分区中。
2 changes: 1 addition & 1 deletion docs/manual-CN/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
* [Gremlin V.S. nGQL](5.appendix/gremlin-ngql.md)
* [Cypher V.S. nGQL](5.appendix/cypher-ngql.md)
* [SQL V.S. nGQL](5.appendix/sql-ngql.md)
<!-- * [升级 Nebula Graph](5.appendix/upgrade-guide.md) -->
* [点 ID 和分区](5.appendix/vid-partition.md)

## 其他

Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ nav:
- Cypher & nGQL: manual-CN/5.appendix/cypher-ngql.md
- Gremlin & nGQL: manual-CN/5.appendix/gremlin-ngql.md
- SQL & nGQL: manual-CN/5.appendix/sql-ngql.md
#- 升级 Nebula Graph: manual-CN/5.appendix/upgrade-guide.md
- 点 ID 和分区: manual-CN/5.appendix/vid-partition.md
amber-moe marked this conversation as resolved.
Show resolved Hide resolved


- English:
- https://docs.nebula-graph.io/
Expand Down