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

Properties() function reduces query performance #2623

Merged
merged 3 commits into from
Mar 1, 2023
Merged
Changes from all commits
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
16 changes: 16 additions & 0 deletions docs-2.0/3.ngql-guide/6.functions-and-expressions/4.schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ nebula> LOOKUP ON player WHERE player.age > 45 \
+-------------------------------------+
```

用户也可以使用属性引用符(`$^`和`$$`)替代函数`properties()`中的`vertex`参数来获取点的所有属性。

- `$^`表示探索开始时的点数据。例如`GO FROM "player100" OVER follow reversely YIELD properties($^)`中,`$^`指`player100`这个点。

- `$$`表示探索结束的终点数据。

`properties($^)`和`properties($$)`一般用于`GO`语句中。更多信息,请参见[属性引用符](../5.operators/5.property-reference.md)。

!!! caution

用户可以通过`properties().<property_name>`来获取点的指定属性。但是不建议使用这种方式获取指定属性,因为`properties()`函数返回所有属性,这样会降低查询性能。
cooper-lzy marked this conversation as resolved.
Show resolved Hide resolved

### properties(edge)

properties(edge) 返回边的所有属性。
Expand All @@ -77,6 +89,10 @@ nebula> GO FROM "player100" OVER follow \
+------------------+
```

!!! warning

用户可以通过`properties(edge).<property_name>`来获取边的指定属性。但是不建议使用这种方式获取指定属性,因为`properties(edge)`函数返回边的所有属性,这样会降低查询性能。

### type(edge)

type(edge) 返回边的 Edge type。
Expand Down