From 8ada2de5ea37b160b658d3fe8a8a16819e72b8bb Mon Sep 17 00:00:00 2001 From: foesa <35463247+foesa-yang@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:40:44 +0800 Subject: [PATCH 1/4] ignore existed index and add keywords --- .../keywords-and-reserved-words.md | 1 + .../12.vertex-statements/1.insert-vertex.md | 62 ++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/docs-2.0/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md b/docs-2.0/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md index ae5e8084472..6646747ace0 100644 --- a/docs-2.0/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md +++ b/docs-2.0/3.ngql-guide/1.nGQL-overview/keywords-and-reserved-words.md @@ -66,6 +66,7 @@ GET GO GRANT IF +IGNORE_EXISTED_INDEX IN INDEX INDEXES diff --git a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md index 4c5bf8930d2..f1bfac11e9e 100644 --- a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md +++ b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md @@ -9,7 +9,6 @@ ## 语法 ```ngql - INSERT VERTEX [IF NOT EXISTS] [tag_props, [tag_props] ...] VALUES VID: ([prop_value_list]) @@ -23,7 +22,31 @@ prop_value_list: [prop_value [, prop_value] ...] ``` -- `IF NOT EXISTS`:用户可以使用`IF NOT EXISTS`关键字检测待插入的 VID 是否存在,只有不存在时,才会插入,如果已经存在,不会进行修改。 + + + +- `IF NOT EXISTS`:用户可以使用 `IF NOT EXISTS` 关键字检测待插入的 VID 是否存在,只有不存在时,才会插入,如果已经存在,不会进行修改。 !!! Note @@ -63,6 +86,41 @@ nebula> CREATE TAG IF NOT EXISTS t1(); nebula> INSERT VERTEX t1() VALUES "10":(); ``` + + ```ngql nebula> CREATE TAG IF NOT EXISTS t2 (name string, age int); nebula> INSERT VERTEX t2 (name, age) VALUES "11":("n1", 12); From 9b36231c33887f0c04b5ce1b54f9eb512535a4ea Mon Sep 17 00:00:00 2001 From: foesa <35463247+foesa-yang@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:50:12 +0800 Subject: [PATCH 2/4] Update docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md Co-authored-by: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> --- docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md index f1bfac11e9e..dcdc0574e1e 100644 --- a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md +++ b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md @@ -38,7 +38,7 @@ prop_value_list: [prop_value [, prop_value] ...] ``` -- IGNORE_EXISTED_INDEX:用户可以使用 `IGNORE_EXISTED_INDEX` 关键字忽略索引插入点。第一次导入时使用 `IGNORE_EXISTED_INDEX`,可大幅度提升性能。 +- `IGNORE_EXISTED_INDEX`:插入点后不更新索引。建议在第一次导入时使用`IGNORE_EXISTED_INDEX`,可大幅度提升性能。 !!! danger From 0f05d2f982c0b6b374ae39adffb2d048d17bf17d Mon Sep 17 00:00:00 2001 From: foesa <35463247+foesa-yang@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:50:22 +0800 Subject: [PATCH 3/4] Update docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md Co-authored-by: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> --- docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md index dcdc0574e1e..7eefdfed59e 100644 --- a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md +++ b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md @@ -46,7 +46,7 @@ prop_value_list: ---> -- `IF NOT EXISTS`:用户可以使用 `IF NOT EXISTS` 关键字检测待插入的 VID 是否存在,只有不存在时,才会插入,如果已经存在,不会进行修改。 +- `IF NOT EXISTS`:检测待插入的 VID 是否存在,只有不存在时,才会插入,如果已经存在,不会进行修改。 !!! Note From 19878ceaa38bc6db7d1995e8dd842319a5211463 Mon Sep 17 00:00:00 2001 From: foesa <35463247+foesa-yang@users.noreply.github.com> Date: Mon, 10 Jan 2022 17:53:05 +0800 Subject: [PATCH 4/4] Update 1.insert-vertex.md --- docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md index 7eefdfed59e..7809a69409a 100644 --- a/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md +++ b/docs-2.0/3.ngql-guide/12.vertex-statements/1.insert-vertex.md @@ -42,7 +42,7 @@ prop_value_list: !!! danger - 使用 `IGNORE_EXISTED_INDEX` 关键字时不删除旧索引,查找时可能会读取到错误数据。 + 使用`IGNORE_EXISTED_INDEX`关键字时不删除旧索引,查找时可能会读取到错误数据。需要重新创建索引,详情信息见 [REBUILD INDEX](../3/../14.native-index-statements/4.rebuild-native-index.md。 --->