You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs-2.0/1.introduction/3.nebula-graph-architecture/2.meta-service.md
+2-4
Original file line number
Diff line number
Diff line change
@@ -45,11 +45,9 @@ The Meta Service stores the schema information. Besides, it performs the additio
45
45
46
46
For more information on Nebula Graph schema, see [Data model](../2.data-model.md).
47
47
48
-
### Manages TTL-based data eviction
48
+
### Manages TTL information
49
49
50
-
The Meta Service provides automatic data eviction and space reclamation based on TTL (time to live) options for Nebula Graph.
51
-
52
-
For more information on TTL, see [TTL options](../../3.ngql-guide/8.clauses-and-options/ttl-options.md).
50
+
The Meta Service stores the definition of TTL (Time to Live) options which are used to control data expiration. The Storage Service takes care of the expiring and evicting processes. For more information, see [TTL](../../3.ngql-guide/8.clauses-and-options/ttl-options.md).
If the **Leader distribution** is uneven, use `BALANCE LEADER` to redistribute the partitions. For more information, see [BALANCE](../8.service-tuning/load-balance.md).
@@ -134,7 +131,6 @@ To make sure the follow-up operations work as expected, take one of the followin
134
131
135
132
```ngql
136
133
nebula[(none)]> USE basketballplayer;
137
-
Execution succeeded (time spent 1229/2318 us)
138
134
```
139
135
140
136
You can use `SHOW SPACES` to check the graph space you created.
@@ -146,7 +142,6 @@ To make sure the follow-up operations work as expected, take one of the followin
146
142
+--------------------+
147
143
| "basketballplayer" |
148
144
+--------------------+
149
-
Got 1 rows (time spent 977/2000 us)
150
145
```
151
146
152
147
## Create tags and edge types
@@ -174,16 +169,12 @@ Create tags `player` and `team`, edge types `follow` and `serve`. Descriptions a
@@ -305,30 +288,28 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
305
288
306
289
### Examples of `GO` statement
307
290
308
-
* Search for the players that the player with VID `player100` follows.
291
+
* Search for the players that the player with VID `player101` follows.
309
292
310
293
```ngql
311
-
nebula> GO FROM "player100" OVER follow;
294
+
nebula> GO FROM "player101" OVER follow;
312
295
+-------------+
313
296
| follow._dst |
314
297
+-------------+
315
-
| "player101" |
298
+
| "player100" |
316
299
| "player102" |
317
300
+-------------+
318
-
Got 2 rows (time spent 12097/14220 us)
319
301
```
320
302
321
-
* Filter the players that the player with VID `player100` follows whose age is equal to or greater than 35. Rename the corresponding columns in the results with `Teammate` and `Age`.
303
+
* Filter the players that the player with VID `player101` follows whose age is equal to or greater than 35. Rename the corresponding columns in the results with `Teammate` and `Age`.
322
304
323
305
```ngql
324
-
nebula> GO FROM "player100" OVER follow WHERE properties($$).age >= 35 \
306
+
nebula> GO FROM "player101" OVER follow WHERE properties($$).age >= 35 \
325
307
YIELD properties($$).name AS Teammate, properties($$).age AS Age;
326
-
+-----------------+-----+
327
-
| Teammate | Age |
328
-
+-----------------+-----+
329
-
| "Tony Parker" | 36 |
330
-
| "Manu Ginobili" | 41 |
331
-
+-----------------+-----+
308
+
+--------------+-----+
309
+
| Teammate | Age |
310
+
+--------------+-----+
311
+
| "Tim Duncan" | 42 |
312
+
+--------------+-----+
332
313
```
333
314
334
315
| Clause/Sign | Description |
@@ -337,21 +318,19 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
337
318
| `$$` | Represents the target vertices. |
338
319
| `\` | A line-breaker. |
339
320
340
-
* Search for the players that the player with VID `player100` follows. Then Retrieve the teams of the players that the player with VID `player100` follows. To combine the two queries, use a pipe or a temporary variable.
321
+
* Search for the players that the player with VID `player101` follows. Then Retrieve the teams of the players that the player with VID `player100` follows. To combine the two queries, use a pipe or a temporary variable.
341
322
342
323
* With a pipe:
343
324
344
325
```ngql
345
-
nebula> GO FROM "player100" OVER follow YIELD dst(edge) AS id | \
326
+
nebula> GO FROM "player101" OVER follow YIELD dst(edge) AS id | \
346
327
GO FROM $-.id OVER serve YIELD properties($$).name AS Team, \
347
328
properties($^).name AS Player;
348
-
+-----------+-----------------+
349
-
| Team | Player |
350
-
+-----------+-----------------+
351
-
| "Spurs" | "Tony Parker" |
352
-
| "Hornets" | "Tony Parker" |
353
-
| "Spurs" | "Manu Ginobili" |
354
-
+-----------+-----------------+
329
+
+-----------------+---------------------+
330
+
| Team | Player |
331
+
+-----------------+---------------------+
332
+
| "Trail Blazers" | "LaMarcus Aldridge" |
333
+
+-----------------+---------------------+
355
334
```
356
335
357
336
|Clause/Sign|Description|
@@ -367,16 +346,14 @@ Users can use the `INSERT` statement to insert vertices or edges based on existi
367
346
Once a composite statement is submitted to the server as a whole, the life cycle of the temporary variables in the statement ends.
368
347
369
348
```ngql
370
-
nebula> $var = GO FROM "player100" OVER follow YIELD dst(edge) AS id; \
349
+
nebula> $var = GO FROM "player101" OVER follow YIELD dst(edge) AS id; \
371
350
GO FROM $var.id OVER serve YIELD properties($$).name AS Team, \
372
351
properties($^).name AS Player;
373
-
+-----------+-----------------+
374
-
| Team | Player |
375
-
+-----------+-----------------+
376
-
| "Spurs" | "Tony Parker" |
377
-
| "Hornets" | "Tony Parker" |
378
-
| "Spurs" | "Manu Ginobili" |
379
-
+-----------+-----------------+
352
+
+-----------------+---------------------+
353
+
| Team | Player |
354
+
+-----------------+---------------------+
355
+
| "Trail Blazers" | "LaMarcus Aldridge" |
356
+
+-----------------+---------------------+
380
357
```
381
358
382
359
### Example of `FETCH` statement
@@ -435,49 +412,41 @@ Users can use the `UPDATE` or the `UPSERT` statements to update existing data.
435
412
436
413
```ngql
437
414
nebula> UPDATE VERTEX "player100" SET player.name = "Tim";
438
-
Execution succeeded (time spent 3483/3914 us)
439
415
440
416
nebula> FETCH PROP ON player "player100";
441
417
+---------------------------------------------+
442
418
| vertices_ |
443
419
+---------------------------------------------+
444
420
| ("player100" :player{age: 42, name: "Tim"}) |
445
421
+---------------------------------------------+
446
-
Got 1 rows (time spent 2463/3042 us)
447
422
```
448
423
449
424
* `UPDATE` the `degree` property of an edge and check the result with the `FETCH` statement.
450
425
451
426
```ngql
452
-
nebula> UPDATE EDGE "player100" -> "player101" OF follow SET degree = 96;
453
-
Execution succeeded (time spent 3932/4432 us)
427
+
nebula> UPDATE EDGE "player101" -> "player100" OF follow SET degree = 96;
454
428
455
-
nebula> FETCH PROP ON follow "player100" -> "player101";
429
+
nebula> FETCH PROP ON follow "player101" -> "player100";
@@ -538,15 +505,6 @@ Users can add indexes to tags and edge types with the [CREATE INDEX](../3.ngql-g
538
505
REBUILD {TAG | EDGE} INDEX <index_name>;
539
506
```
540
507
541
-
### Examples
542
-
543
-
Create and rebuild indexes for the `name` property on all vertices with the tag `player`.
544
-
545
-
```ngql
546
-
nebula> CREATE TAG INDEX player_index_0 on player(name(20));
547
-
nebula> REBUILD TAG INDEX player_index_0;
548
-
```
549
-
550
508
!!! note
551
509
552
510
Define the index length when creating an index for a variable-length property. In UTF-8 encoding, a non-ascii character occupies 3 bytes. You should set an appropriate index length according to the variable-length property. For example, the index should be 30 bytes for 10 non-ascii characters. For more information, see [CREATE INDEX](../3.ngql-guide/14.native-index-statements/1.create-native-index.md)
@@ -557,17 +515,16 @@ Make sure there is an [index](#about_indexes) for `LOOKUP` or `MATCH` to use. If
557
515
558
516
Find the information of the vertex with the tag `player` and its value of the `name` property is `Tony Parker`.
559
517
560
-
This example creates the index `player_name_0` on the player name property.
518
+
This example creates the index `player_index_1` on the player name property.
561
519
562
520
```nGQL
563
-
nebula> CREATE TAG INDEX player_name_0 on player(name(10));
564
-
Execution succeeded (time spent 3465/4150 us)
521
+
nebula> CREATE TAG INDEX player_index_1 ON player(name(20));
565
522
```
566
523
567
524
This example rebuilds the index to make sure it takes effect on pre-existing data.
568
525
569
526
```nGQL
570
-
nebula> REBUILD TAG INDEX player_name_0
527
+
nebula> REBUILD TAG INDEX player_index_1
571
528
+------------+
572
529
| New Job Id |
573
530
+------------+
@@ -580,12 +537,12 @@ This example uses the `LOOKUP` statement to retrieve the vertex property.
580
537
581
538
```nGQL
582
539
nebula> LOOKUP ON player WHERE player.name == "Tony Parker" \
583
-
YIELD player.name, player.age;
584
-
+-------------+---------------+------------+
585
-
| VertexID | player.name | player.age |
586
-
+-------------+---------------+------------+
587
-
| "player101" | "Tony Parker" | 36 |
588
-
+-------------+---------------+------------+
540
+
YIELD properties(vertex).name AS name, properties(vertex).age AS age;
541
+
+-------------+---------------+-----+
542
+
| VertexID | name | age |
543
+
+-------------+---------------+-----+
544
+
| "player101" | "Tony Parker" | 36 |
545
+
+-------------+---------------+-----+
589
546
```
590
547
591
548
This example uses the `MATCH` statement to retrieve the vertex property.
@@ -597,5 +554,4 @@ nebula> MATCH (v:player{name:"Tony Parker"}) RETURN v;
0 commit comments