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

Performance issue when pattern comprehension expands TO input values #1989

Open
Darych opened this issue Apr 29, 2024 · 0 comments
Open

Performance issue when pattern comprehension expands TO input values #1989

Darych opened this issue Apr 29, 2024 · 0 comments
Assignees
Labels
bug bug Effort - Medium Effort - Medium Frequency - Monthly Frequency - Monthly Priority - Later Priority - Later Reach - VeryFew Reach - VeryFew Severity - S3 Severity - S3

Comments

@Darych
Copy link
Contributor

Darych commented Apr 29, 2024

Memgraph version
2.16.0

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. EXPLAIN MATCH (n:Person) WITH n AS actor, [(m)-->(n) WHERE m.released < 3000 | m.released] AS years RETURN actor.name, years;
  2. In the plan additional ScanAll for (m) is present.

Workaround
Run EXPLAIN MATCH (n:Person) WITH n AS actor, [(n)<--(m) WHERE m.released < 3000 | m.released] AS years RETURN actor.name, years;
Be sure that the input vertex for pattern comprehension is first in the expansion inside pattern comprehension.

Expected behavior
No ScanAll, pattern comprehension branch should expand from the input vertex.

Logs
Not optimized plan:

+----------------------------------+
| QUERY PLAN                       |
+----------------------------------+
| " * Produce {actor.name, years}" |
| " * Produce {actor, years}"      |
| " * RollUpApply"                 |
| " |\\ "                          |
| " | * Produce {anon2}"           |
| " | * Expand (m)-[anon2]->(n)"   |
| " | * Filter {m.released}"       |
| " | * ScanAll (m)"               |
| " | * Once"                      |
| " * Filter (n :Person)"          |
| " * ScanAll (n)"                 |
| " * Once"                        |
+----------------------------------+

Optimized should be:

+----------------------------------+
| QUERY PLAN                       |
+----------------------------------+
| " * Produce {actor.name, years}" |
| " * Produce {actor, years}"      |
| " * RollUpApply"                 |
| " |\\ "                          |
| " | * Produce {anon2}"           |
| " | * Filter {m.released}"       |
| " | * Expand (n)<-[anon2]-(m)"   |
| " | * Once"                      |
| " * Filter (n :Person)"          |
| " * ScanAll (n)"                 |
| " * Once"                        |
+----------------------------------+
@Darych Darych added the bug bug label Apr 29, 2024
@Darych Darych self-assigned this Apr 29, 2024
@gitbuda gitbuda added Severity - S3 Severity - S3 Reach - VeryFew Reach - VeryFew Frequency - Monthly Frequency - Monthly labels Apr 30, 2024
@Darych Darych added the Effort - Medium Effort - Medium label Apr 30, 2024
@hal-eisen-MG hal-eisen-MG added the Priority - Later Priority - Later label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug Effort - Medium Effort - Medium Frequency - Monthly Frequency - Monthly Priority - Later Priority - Later Reach - VeryFew Reach - VeryFew Severity - S3 Severity - S3
Projects
None yet
Development

No branches or pull requests

3 participants