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

opt: param indexScan columnHint/prefix scan #4820

Closed
wey-gu opened this issue Nov 3, 2022 · 0 comments
Closed

opt: param indexScan columnHint/prefix scan #4820

wey-gu opened this issue Nov 3, 2022 · 0 comments
Assignees
Labels
severity/minor Severity of bug type/bug Type: something is unexpected type/enhancement Type: make the code neat or more efficient
Milestone

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Nov 3, 2022

Introduction

For Cypher Param case, the index scan isn't optimal:

We could see there is no columnHint or prefix scan info for the indexScan, and it fully scans all data(rows: 51).

(root@nebula) [basketballplayer]> :param p0 => 'Tim Duncan';
(root@nebula) [basketballplayer]> profile MATCH (n: player) WHERE n.player.name == $p0 RETURN n;
+----------------------------------------------------+
| n                                                  |
+----------------------------------------------------+
| ("player100" :player{age: 42, name: "Tim Duncan"}) |
+----------------------------------------------------+
Got 1 rows (time spent 6760/13199 us)
...
-----+----------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------
|  1 | IndexScan      | 2            | {                                                                                                                                                                     | outputVar: {                     |
|    |                |              | ver: 0, rows: 51, execTime: 0us, totalTime: 1683us                                                                                                                    |   "colNames": [                  |
|    |                |              | "storaged2":9779 exec/total: 437(us)/1359(us)                                                                                                                         |     "_vid"                       |
|    |                |              | "storaged1":9779 exec/total: 406(us)/1339(us)                                                                                                                         |   ],                             |
|    |                |              | "storaged0":9779 exec/total: 342(us)/1385(us)                                                                                                                         |   "type": "DATASET",             |
|    |                |              | storage_detail: {IndexLimitNode(limit=9223372036854775807):205(us),IndexProjectionNode(projectColumn=[_vid]):204(us),IndexVertexScanNode(IndexID=6, Path=()):197(us)} |   "name": "__IndexScan_1"        |
|    |                |              | }                                                                                                                                                                     | }                                |
|    |                |              |                                                                                                                                                                       | inputVar:                        |
|    |                |              |                                                                                                                                                                       | space: 1                         |
|    |                |              |                                                                                                                                                                       | dedup: false                     |
|    |                |              |                                                                                                                                                                       | limit: 9223372036854775807       |
|    |                |              |                                                                                                                                                                       | filter:                          |
|    |                |              |                                                                                                                                                                       | orderBy: []                      |
|    |                |              |                                                                                                                                                                       | schemaId: 2                      |
|    |                |              |                                                                                                                                                                       | isEdge: false                    |
|    |                |              |                                                                                                                                                                       | returnCols: [                    |
|    |                |              |                                                                                                                                                                       |   "_vid"                         |
|    |                |              |                                                                                                                                                                       | ]                                |
|    |                |              |                                                                                                                                                                       | indexCtx: [                      |
|    |                |              |                                                                                                                                                                       |   {                              |
|    |                |              |                                                                                                                                                                       |     "columnHints": [],           |
|    |                |              |                                                                                                                                                                       |     "filter": "",                |
|    |                |              |                                                                                                                                                                       |     "index_id": 6                |
|    |                |              |                                                                                                                                                                       |   }                              |
|    |                |              |                                                                                                                                                                       | ]                                |
-----+----------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------
|  2 | Start          |              | ver: 0, rows: 0, execTime: 0us, totalTime: 27us                                                                                                                       | outputVar: {                     |
|    |                |              |                                                                                                                                                                       |   "colNames": [],                |
|    |                |              |                                                                                                                                                                       |   "type": "DATASET",             |
|    |                |              |                                                                                                                                                                       |   "name": "__Start_2"            |
|    |                |              |                                                                                                                                                                       | }                                |
-----+----------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------

Contents

Related work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor Severity of bug type/bug Type: something is unexpected type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

4 participants