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

[optimizer] Add Column Pruning Rule #2496

Open
yixinglu opened this issue Jul 19, 2021 · 0 comments
Open

[optimizer] Add Column Pruning Rule #2496

yixinglu opened this issue Jul 19, 2021 · 0 comments
Labels
type/enhancement Type: make the code neat or more efficient

Comments

@yixinglu
Copy link
Contributor

Plan fragment could be applied this rule:

-----+--------------------+--------------+----------------+--------------------------------------------------------------------------------------------
| 27 | Project            | 30           |                | outputVar: [                                                                              |
|    |                    |              |                |   {                                                                                       |
|    |                    |              |                |     "colNames": [                                                                         |
|    |                    |              |                |       "v2"                                                                                |
|    |                    |              |                |     ],                                                                                    |
|    |                    |              |                |     "type": "DATASET",                                                                    |
|    |                    |              |                |     "name": "__Project_27"                                                                |
|    |                    |              |                |   }                                                                                       |
|    |                    |              |                | ]                                                                                         |
|    |                    |              |                | inputVar: __Filter_26                                                                     |
|    |                    |              |                | columns: [                                                                                |
|    |                    |              |                |   "$v2"                                                                                   |
|    |                    |              |                | ]                                                                                         |
-----+--------------------+--------------+----------------+--------------------------------------------------------------------------------------------
| 30 | Filter             | 24           |                | outputVar: [                                                                              |
|    |                    |              |                |   {                                                                                       |
|    |                    |              |                |     "colNames": [                                                                         |
|    |                    |              |                |       "v",                                                                                |
|    |                    |              |                |       "e",                                                                                |
|    |                    |              |                |       "v2",                                                                               |
|    |                    |              |                |       "__COL_0"                                                                           |
|    |                    |              |                |     ],                                                                                    |
|    |                    |              |                |     "type": "DATASET",                                                                    |
|    |                    |              |                |     "name": "__Filter_26"                                                                 |
|    |                    |              |                |   }                                                                                       |
|    |                    |              |                | ]                                                                                         |
|    |                    |              |                | inputVar: __Project_24                                                                    |
|    |                    |              |                | condition: (($v2.age>30) AND !(hasSameEdgeInPath($-.__COL_0)))                            |
-----+--------------------+--------------+----------------+--------------------------------------------------------------------------------------------
| 24 | Project            | 23           |                | outputVar: [                                                                              |
|    |                    |              |                |   {                                                                                       |
|    |                    |              |                |     "colNames": [                                                                         |
|    |                    |              |                |       "v",                                                                                |
|    |                    |              |                |       "e",                                                                                |
|    |                    |              |                |       "v2",                                                                               |
|    |                    |              |                |       "__COL_0"                                                                           |
|    |                    |              |                |     ],                                                                                    |
|    |                    |              |                |     "type": "DATASET",                                                                    |
|    |                    |              |                |     "name": "__Project_24"                                                                |
|    |                    |              |                |   }                                                                                       |
|    |                    |              |                | ]                                                                                         |
|    |                    |              |                | inputVar: __InnerJoin_23                                                                  |
|    |                    |              |                | columns: [                                                                                |
|    |                    |              |                |   "startNode($-._path_0) AS v",                                                           |
|    |                    |              |                |   "relationships($-._path_0) AS e",                                                       |
|    |                    |              |                |   "startNode($-._path_1) AS v2",                                                          |
|    |                    |              |                |   "PathBuild[PathBuild[$-._path_0,$-._path_1]] AS __COL_0"                                |
|    |                    |              |                | ]                                                                                         |
-----+--------------------+--------------+----------------+--------------------------------------------------------------------------------------------

The result set needs not the variables e and v, we can prune the columns in optimization stage and avoid useless evaluation at runtime.

@yixinglu yixinglu transferred this issue from vesoft-inc/nebula-graph Aug 11, 2021
@CPWstatic CPWstatic added type/enhancement Type: make the code neat or more efficient type/feature req Type: feature request labels Aug 27, 2021
@Sophie-Xie Sophie-Xie removed the type/feature req Type: feature request label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

3 participants