Skip to content

Commit

Permalink
Properties() function reduces query performance (#2623)
Browse files Browse the repository at this point in the history
* properties()-function-reduces-query-performance

* Update 4.schema.md

* Update 4.schema.md
  • Loading branch information
abby-cyber authored Mar 1, 2023
1 parent 1503378 commit 4a78626
Showing 1 changed file with 16 additions and 0 deletions.
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()`函数返回所有属性,这样会降低查询性能。

### 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

0 comments on commit 4a78626

Please sign in to comment.