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

Move input rows in Traverse/AppendVertices based on lifetime analysis #4172

Closed
Shylock-Hg opened this issue Apr 18, 2022 · 0 comments · Fixed by #4176
Closed

Move input rows in Traverse/AppendVertices based on lifetime analysis #4172

Shylock-Hg opened this issue Apr 18, 2022 · 0 comments · Fixed by #4176
Assignees
Labels
type/enhancement Type: make the code neat or more efficient
Milestone

Comments

@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Apr 18, 2022

Introduction

Now we can determine the lifetime of variable, so we can move input rows when input variable reach end of life.
It's a trick optimization of #3075, special implementation of specific plan node Traverse and AppendVertices.
Subjob of #4122
Contents

e.g.

      explain format = 'dot'
      MATCH
        (country:Country)<-[:IS_PART_OF]-(:City)<-[:IS_LOCATED_IN]-(person:Person)
        <-[:HAS_CREATOR]-(message:Message)-[:HAS_TAG]->(`tag`:`Tag`)
      WHERE message.Message.creationDate >= "20091231230000000"
        AND message.Message.creationDate <= "20101107230000000"
        AND (id(country) == "Ethiopia" OR id(country) == "Belarus")
      WITH
        country.Country.name AS countryName,
        toInteger(message.Message.creationDate)/100000000000%100 AS month,
        person.Person.gender AS gender,
        floor((20130101 - person.Person.birthday) / 10000 / 5.0) AS ageGroup,
        `tag`.`Tag`.name AS tagName,
        message
      WITH
        countryName, month, gender, ageGroup, tagName, count(message) AS messageCount
      WHERE messageCount > 100
      RETURN
        countryName,
        month,
        gender,
        ageGroup,
        tagName,
        messageCount
      ORDER BY
        messageCount DESC,
        tagName ASC,
        ageGroup ASC,
        gender ASC,
        month ASC,
        countryName ASC
      LIMIT 100

graphviz (3)

So many unused copy happens between Traverse and AppednVertices, we could move it directly.

Related work

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

Successfully merging a pull request may close this issue.

1 participant