match条件中使用建立索引字段查询慢

  • nebula 版本:2.0.0
  • 部署方式(分布式 / 单机 / Docker / DBaaS):单机
  • 是否为线上版本:Y
  • 硬件信息
    • 磁盘: SSD
    • CPU、内存信息 : 4c8g
  • 问题的具体描述
  1. 使用in查询效率慢
    user_id已加入索引

PROFILE match (v:t_user) where v.user_id==‘1’ return v;
该语句查询时间 Got 1 rows (time spent 32546/33552 us)

PROFILE match (v:t_user) where v.user_id in [‘1’] return v;
该语句查询时间 Got 1 rows (time spent 363767320/363747892 us)

PROFILE 信息分别为

Execution Plan (optimize time 96 us)

-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
| id | name        | dependencies | profiling data                                    | operator info                                     |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
| 10 | Project     | 9            | ver: 0, rows: 1, execTime: 5us, totalTime: 5us    | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [                                 |
|    |             |              |                                                   |       "v"                                         |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "name": "__Project_10",                       |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __Filter_9                              |
|    |             |              |                                                   | columns: [                                        |
|    |             |              |                                                   |   "$v"                                            |
|    |             |              |                                                   | ]                                                 |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
|  9 | Filter      | 8            | ver: 0, rows: 1, execTime: 3us, totalTime: 3us    | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [                                 |
|    |             |              |                                                   |       "v",                                        |
|    |             |              |                                                   |       "__COL_0"                                   |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "name": "__Filter_9",                         |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __Filter_8                              |
|    |             |              |                                                   | condition: ($v.user_id=="1")                      |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
|  8 | Filter      | 7            | ver: 0, rows: 1, execTime: 13us, totalTime: 13us  | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [                                 |
|    |             |              |                                                   |       "v",                                        |
|    |             |              |                                                   |       "__COL_0"                                   |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "name": "__Filter_8",                         |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __Project_7                             |
|    |             |              |                                                   | condition: (hasSameEdgeInPath($-.__COL_0)==false) |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
|  7 | Project     | 6            | ver: 0, rows: 1, execTime: 18us, totalTime: 19us  | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [                                 |
|    |             |              |                                                   |       "v",                                        |
|    |             |              |                                                   |       "__COL_0"                                   |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "name": "__Project_7",                        |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __Project_6                             |
|    |             |              |                                                   | columns: [                                        |
|    |             |              |                                                   |   "startNode($-._path) AS v",                     |
|    |             |              |                                                   |   "reversePath(PathBuild[$-._path]) AS __COL_0"   |
|    |             |              |                                                   | ]                                                 |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
|  6 | Project     | 5            | ver: 0, rows: 1, execTime: 19us, totalTime: 20us  | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [                                 |
|    |             |              |                                                   |       "_path"                                     |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "name": "__Project_6",                        |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __Filter_5                              |
|    |             |              |                                                   | columns: [                                        |
|    |             |              |                                                   |   "PathBuild[VERTEX]"                             |
|    |             |              |                                                   | ]                                                 |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
|  5 | Filter      | 13           | ver: 0, rows: 1, execTime: 27us, totalTime: 28us  | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [],                               |
|    |             |              |                                                   |     "name": "__Filter_5",                         |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __GetVertices_4                         |
|    |             |              |                                                   | condition: ("t_user" IN tags(VERTEX))             |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
| 13 | GetVertices | 11           | {                                                 | outputVar: [                                      |
|    |             |              | ver: 0, rows: 1, execTime: 94us, totalTime: 944us |   {                                               |
|    |             |              | "10.10.11.46":9779 exec/total: 118(us)/724(us)    |     "colNames": [],                               |
|    |             |              | total_rpc: 843(us)                                |     "name": "__GetVertices_4",                    |
|    |             |              | }                                                 |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar: __IndexScan_1                           |
|    |             |              |                                                   | space: 1                                          |
|    |             |              |                                                   | dedup: true                                       |
|    |             |              |                                                   | limit: 9223372036854775807                        |
|    |             |              |                                                   | filter:                                           |
|    |             |              |                                                   | orderBy: []                                       |
|    |             |              |                                                   | src: $_vid                                        |
|    |             |              |                                                   | props: [                                          |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "props": [                                    |
|    |             |              |                                                   |       "user_id",                                  |
|    |             |              |                                                   |       "sdk_u",                                    |
|    |             |              |                                                   |       "sdk_cs",                                   |
|    |             |              |                                                   |       "nick_name",                                |
|    |             |              |                                                   |       "create_time",                              |
|    |             |              |                                                   |       "_tag"                                      |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "tagId": 2                                    |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | exprs: []                                         |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
| 11 | IndexScan   | 0            | ver: 0, rows: 1, execTime: 0us, totalTime: 2583us | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [                                 |
|    |             |              |                                                   |       "_vid"                                      |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "name": "__IndexScan_1",                      |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | inputVar:                                         |
|    |             |              |                                                   | space: 1                                          |
|    |             |              |                                                   | dedup: false                                      |
|    |             |              |                                                   | limit: 9223372036854775807                        |
|    |             |              |                                                   | filter:                                           |
|    |             |              |                                                   | orderBy: []                                       |
|    |             |              |                                                   | schemaId: 2                                       |
|    |             |              |                                                   | isEdge: false                                     |
|    |             |              |                                                   | returnCols: [                                     |
|    |             |              |                                                   |   "_vid"                                          |
|    |             |              |                                                   | ]                                                 |
|    |             |              |                                                   | indexCtx: [                                       |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "columnHints": [                              |
|    |             |              |                                                   |       {                                           |
|    |             |              |                                                   |         "endValue": "__EMPTY__",                  |
|    |             |              |                                                   |         "beginValue": "\"1",                      |
|    |             |              |                                                   |         "column": "user_id",                      |
|    |             |              |                                                   |         "scanType": "PREFIX"                      |
|    |             |              |                                                   |       }                                           |
|    |             |              |                                                   |     ],                                            |
|    |             |              |                                                   |     "index_id": 5,                                |
|    |             |              |                                                   |     "filter": ""                                  |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
|  0 | Start       |              | ver: 0, rows: 0, execTime: 3us, totalTime: 91us   | outputVar: [                                      |
|    |             |              |                                                   |   {                                               |
|    |             |              |                                                   |     "colNames": [],                               |
|    |             |              |                                                   |     "name": "__Start_0",                          |
|    |             |              |                                                   |     "type": "DATASET"                             |
|    |             |              |                                                   |   }                                               |
|    |             |              |                                                   | ]                                                 |
-----+-------------+--------------+---------------------------------------------------+----------------------------------------------------
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
| id | name        | dependencies | profiling data                                                  | operator info                                     |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
| 10 | Project     | 9            | ver: 0, rows: 1, execTime: 14us, totalTime: 16us                | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [                                 |
|    |             |              |                                                                 |       "v"                                         |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "name": "__Project_10",                       |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __Filter_9                              |
|    |             |              |                                                                 | columns: [                                        |
|    |             |              |                                                                 |   "$v"                                            |
|    |             |              |                                                                 | ]                                                 |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
|  9 | Filter      | 8            | ver: 0, rows: 1, execTime: 354138782us, totalTime: 354138789us  | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [                                 |
|    |             |              |                                                                 |       "v",                                        |
|    |             |              |                                                                 |       "__COL_0"                                   |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "name": "__Filter_9",                         |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __Filter_8                              |
|    |             |              |                                                                 | condition: ($v.user_id IN ["1"])                  |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
|  8 | Filter      | 7            | ver: 0, rows: 500000, execTime: 445037us, totalTime: 445044us   | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [                                 |
|    |             |              |                                                                 |       "v",                                        |
|    |             |              |                                                                 |       "__COL_0"                                   |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "name": "__Filter_8",                         |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __Project_7                             |
|    |             |              |                                                                 | condition: (hasSameEdgeInPath($-.__COL_0)==false) |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
|  7 | Project     | 6            | ver: 0, rows: 500000, execTime: 2361809us, totalTime: 2361816us | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [                                 |
|    |             |              |                                                                 |       "v",                                        |
|    |             |              |                                                                 |       "__COL_0"                                   |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "name": "__Project_7",                        |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __Project_6                             |
|    |             |              |                                                                 | columns: [                                        |
|    |             |              |                                                                 |   "startNode($-._path) AS v",                     |
|    |             |              |                                                                 |   "reversePath(PathBuild[$-._path]) AS __COL_0"   |
|    |             |              |                                                                 | ]                                                 |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
|  6 | Project     | 5            | ver: 0, rows: 500000, execTime: 1312075us, totalTime: 1312084us | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [                                 |
|    |             |              |                                                                 |       "_path"                                     |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "name": "__Project_6",                        |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __Filter_5                              |
|    |             |              |                                                                 | columns: [                                        |
|    |             |              |                                                                 |   "PathBuild[VERTEX]"                             |
|    |             |              |                                                                 | ]                                                 |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
|  5 | Filter      | 13           | ver: 0, rows: 500000, execTime: 716006us, totalTime: 716014us   | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [],                               |
|    |             |              |                                                                 |     "name": "__Filter_5",                         |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __GetVertices_4                         |
|    |             |              |                                                                 | condition: ("t_user" IN tags(VERTEX))             |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
| 13 | GetVertices | 11           | {                                                               | outputVar: [                                      |
|    |             |              | ver: 0, rows: 500000, execTime: 633033us, totalTime: 2531866us  |   {                                               |
|    |             |              | "10.10.11.46":9779 exec/total: 1285802(us)/1859205(us)          |     "colNames": [],                               |
|    |             |              | total_rpc: 2106420(us)                                          |     "name": "__GetVertices_4",                    |
|    |             |              | }                                                               |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar: __IndexScan_1                           |
|    |             |              |                                                                 | space: 1                                          |
|    |             |              |                                                                 | dedup: true                                       |
|    |             |              |                                                                 | limit: 9223372036854775807                        |
|    |             |              |                                                                 | filter:                                           |
|    |             |              |                                                                 | orderBy: []                                       |
|    |             |              |                                                                 | src: $_vid                                        |
|    |             |              |                                                                 | props: [                                          |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "props": [                                    |
|    |             |              |                                                                 |       "user_id",                                  |
|    |             |              |                                                                 |       "sdk_u",                                    |
|    |             |              |                                                                 |       "sdk_cs",                                   |
|    |             |              |                                                                 |       "nick_name",                                |
|    |             |              |                                                                 |       "create_time",                              |
|    |             |              |                                                                 |       "_tag"                                      |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "tagId": 2                                    |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | exprs: []                                         |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
| 11 | IndexScan   | 0            | ver: 0, rows: 500000, execTime: 0us, totalTime: 2261045us       | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [                                 |
|    |             |              |                                                                 |       "_vid"                                      |
|    |             |              |                                                                 |     ],                                            |
|    |             |              |                                                                 |     "name": "__IndexScan_1",                      |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | inputVar:                                         |
|    |             |              |                                                                 | space: 1                                          |
|    |             |              |                                                                 | dedup: false                                      |
|    |             |              |                                                                 | limit: 9223372036854775807                        |
|    |             |              |                                                                 | filter:                                           |
|    |             |              |                                                                 | orderBy: []                                       |
|    |             |              |                                                                 | schemaId: 2                                       |
|    |             |              |                                                                 | isEdge: false                                     |
|    |             |              |                                                                 | returnCols: [                                     |
|    |             |              |                                                                 |   "_vid"                                          |
|    |             |              |                                                                 | ]                                                 |
|    |             |              |                                                                 | indexCtx: [                                       |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "columnHints": [],                            |
|    |             |              |                                                                 |     "index_id": 5,                                |
|    |             |              |                                                                 |     "filter": ""                                  |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
|  0 | Start       |              | ver: 0, rows: 0, execTime: 1us, totalTime: 53us                 | outputVar: [                                      |
|    |             |              |                                                                 |   {                                               |
|    |             |              |                                                                 |     "colNames": [],                               |
|    |             |              |                                                                 |     "name": "__Start_0",                          |
|    |             |              |                                                                 |     "type": "DATASET"                             |
|    |             |              |                                                                 |   }                                               |
|    |             |              |                                                                 | ]                                                 |
-----+-------------+--------------+-----------------------------------------------------------------+----------------------------------------------------
  1. 索引字段使用or条件后也会变的非常慢

PROFILE match (v:t_user) where v.user_id==‘1’ or v.user_id==‘2’ return v;
该语句查询时间 Got 2 rows (time spent 324092042/324083751 us)

-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
| id | name        | dependencies | profiling data                                                  | operator info                                       |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
| 10 | Project     | 9            | ver: 0, rows: 2, execTime: 16us, totalTime: 17us                | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [                                   |
|    |             |              |                                                                 |       "v"                                           |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "name": "__Project_10",                         |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __Filter_9                                |
|    |             |              |                                                                 | columns: [                                          |
|    |             |              |                                                                 |   "$v"                                              |
|    |             |              |                                                                 | ]                                                   |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
|  9 | Filter      | 8            | ver: 0, rows: 2, execTime: 314903664us, totalTime: 314903670us  | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [                                   |
|    |             |              |                                                                 |       "v",                                          |
|    |             |              |                                                                 |       "__COL_0"                                     |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "name": "__Filter_9",                           |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __Filter_8                                |
|    |             |              |                                                                 | condition: (($v.user_id=="1") OR ($v.user_id=="2")) |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
|  8 | Filter      | 7            | ver: 0, rows: 500000, execTime: 399958us, totalTime: 399965us   | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [                                   |
|    |             |              |                                                                 |       "v",                                          |
|    |             |              |                                                                 |       "__COL_0"                                     |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "name": "__Filter_8",                           |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __Project_7                               |
|    |             |              |                                                                 | condition: (hasSameEdgeInPath($-.__COL_0)==false)   |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
|  7 | Project     | 6            | ver: 0, rows: 500000, execTime: 2176984us, totalTime: 2176991us | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [                                   |
|    |             |              |                                                                 |       "v",                                          |
|    |             |              |                                                                 |       "__COL_0"                                     |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "name": "__Project_7",                          |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __Project_6                               |
|    |             |              |                                                                 | columns: [                                          |
|    |             |              |                                                                 |   "startNode($-._path) AS v",                       |
|    |             |              |                                                                 |   "reversePath(PathBuild[$-._path]) AS __COL_0"     |
|    |             |              |                                                                 | ]                                                   |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
|  6 | Project     | 5            | ver: 0, rows: 500000, execTime: 1308595us, totalTime: 1308602us | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [                                   |
|    |             |              |                                                                 |       "_path"                                       |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "name": "__Project_6",                          |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __Filter_5                                |
|    |             |              |                                                                 | columns: [                                          |
|    |             |              |                                                                 |   "PathBuild[VERTEX]"                               |
|    |             |              |                                                                 | ]                                                   |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
|  5 | Filter      | 13           | ver: 0, rows: 500000, execTime: 673847us, totalTime: 673857us   | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [],                                 |
|    |             |              |                                                                 |     "name": "__Filter_5",                           |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __GetVertices_4                           |
|    |             |              |                                                                 | condition: ("t_user" IN tags(VERTEX))               |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
| 13 | GetVertices | 11           | {                                                               | outputVar: [                                        |
|    |             |              | ver: 0, rows: 500000, execTime: 660308us, totalTime: 2592288us  |   {                                                 |
|    |             |              | "10.10.11.46":9779 exec/total: 1297473(us)/1893500(us)          |     "colNames": [],                                 |
|    |             |              | total_rpc: 2090728(us)                                          |     "name": "__GetVertices_4",                      |
|    |             |              | }                                                               |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar: __IndexScan_1                             |
|    |             |              |                                                                 | space: 1                                            |
|    |             |              |                                                                 | dedup: true                                         |
|    |             |              |                                                                 | limit: 9223372036854775807                          |
|    |             |              |                                                                 | filter:                                             |
|    |             |              |                                                                 | orderBy: []                                         |
|    |             |              |                                                                 | src: $_vid                                          |
|    |             |              |                                                                 | props: [                                            |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "props": [                                      |
|    |             |              |                                                                 |       "user_id",                                    |
|    |             |              |                                                                 |       "sdk_u",                                      |
|    |             |              |                                                                 |       "sdk_cs",                                     |
|    |             |              |                                                                 |       "nick_name",                                  |
|    |             |              |                                                                 |       "create_time",                                |
|    |             |              |                                                                 |       "_tag"                                        |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "tagId": 2                                      |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | exprs: []                                           |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
| 11 | IndexScan   | 0            | ver: 0, rows: 500000, execTime: 0us, totalTime: 2036030us       | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [                                   |
|    |             |              |                                                                 |       "_vid"                                        |
|    |             |              |                                                                 |     ],                                              |
|    |             |              |                                                                 |     "name": "__IndexScan_1",                        |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | inputVar:                                           |
|    |             |              |                                                                 | space: 1                                            |
|    |             |              |                                                                 | dedup: false                                        |
|    |             |              |                                                                 | limit: 9223372036854775807                          |
|    |             |              |                                                                 | filter:                                             |
|    |             |              |                                                                 | orderBy: []                                         |
|    |             |              |                                                                 | schemaId: 2                                         |
|    |             |              |                                                                 | isEdge: false                                       |
|    |             |              |                                                                 | returnCols: [                                       |
|    |             |              |                                                                 |   "_vid"                                            |
|    |             |              |                                                                 | ]                                                   |
|    |             |              |                                                                 | indexCtx: [                                         |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "columnHints": [],                              |
|    |             |              |                                                                 |     "index_id": 5,                                  |
|    |             |              |                                                                 |     "filter": ""                                    |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------
|  0 | Start       |              | ver: 0, rows: 0, execTime: 1us, totalTime: 45us                 | outputVar: [                                        |
|    |             |              |                                                                 |   {                                                 |
|    |             |              |                                                                 |     "colNames": [],                                 |
|    |             |              |                                                                 |     "name": "__Start_0",                            |
|    |             |              |                                                                 |     "type": "DATASET"                               |
|    |             |              |                                                                 |   }                                                 |
|    |             |              |                                                                 | ]                                                   |
-----+-------------+--------------+-----------------------------------------------------------------+------------------------------------------------------

你好, 目前 in 表达式还不支持索引.

or 表达式已经在 https://github.com/vesoft-inc/nebula-graph/pull/1005 中支持了, 目前已合入 master 分支.

1 个赞

点vid是否支持in快速检索?比如id(v) in [vid1,vid2]

P146

我这里测试应该是可以的

PR#1005 支持了 id(v)==vid1 or id(v)==vid2 的快速检索

该主题在最后一个回复创建后7天后自动关闭。不再允许新的回复。

浙ICP备20010487号