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

Very slow graph walk #5401

Closed
porscheme opened this issue Mar 15, 2023 · 4 comments
Closed

Very slow graph walk #5401

porscheme opened this issue Mar 15, 2023 · 4 comments
Labels
affects/none PR/issue: this bug affects none version. duplicate Solution: this issue or pull request already exists process/fixed Process of bug severity/none Severity of bug type/bug Type: something is unexpected

Comments

@porscheme
Copy link

porscheme commented Mar 15, 2023

Version: v3.4.0
@wey-gu
Describe the bug (required)
Very slow graph walk...

  • More than 5 minutes
  • Often times crash
  • Not able to run multiple queries this type in parallel

My Query

MATCH (p:Student)
WHERE id(p) IN [ ... ]

OPTIONAL MATCH (p)<-[:HAS_COURSE]-(a:CourseCodes)
OPTIONAL MATCH (p)<-[:STUDENT_HAS_SOCIAL]-(s:Social)
OPTIONAL MATCH (p)<-[:HAS_PROCEDURE]-(r:ProcedureCodes)

WITH
  p,
  COLLECT(DISTINCT a.CourseCodes.CodeId) as courses,
  COLLECT(DISTINCT s.Social.AttributeId) as social,
  COLLECT(DISTINCT r.ProcedureCodes.CodeId) as procedures

RETURN 
  p.Student.StudentId as Student, 
  p.Student.Gender as sex, 
  p.Student.Race as race, 
  p.Student.Ethnicity as ethnicity, 
  p.Student.MaritalStatus as maritalstatus,
  diagnosis,
  procedures,
  social

Your Environments (required)

  • OS: uname -a
    Linux nebula-cluster-storaged-2 5.4.0-1103-azure Fixed all lint errors #109~18.04.1-Ubuntu SMP Wed Jan 25 20:53:00 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

  • Compiler: g++ --version or clang++ --version
    g++: command not found

  • CPU: lscpu

  • Commit id (e.g. a3ffc7d8)

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1
  2. Step 2
  3. Step 3

Expected behavior

Additional context

@porscheme porscheme added the type/bug Type: something is unexpected label Mar 15, 2023
@github-actions github-actions bot added affects/none PR/issue: this bug affects none version. severity/none Severity of bug labels Mar 15, 2023
@wey-gu
Copy link
Contributor

wey-gu commented Mar 16, 2023

Could you share the profile of the query?

@wey-gu
Copy link
Contributor

wey-gu commented Mar 17, 2023

OPTIONAL MATCH (p)<-[:HAS_COURSE]-(a:CourseCodes)
OPTIONAL MATCH (p)<-[:STUDENT_HAS_SOCIAL]-(s:Social)
OPTIONAL MATCH (p)<-[:HAS_PROCEDURE]-(r:ProcedureCodes)
  • Always put a tag when it's predictable/known, else, it had to scan for all tags on given p.
    like
OPTIONAL MATCH (p: Student)<-[:HAS_COURSE]-(a:CourseCodes)
OPTIONAL MATCH (p: Student)<-[:STUDENT_HAS_SOCIAL]-(s:Social)
OPTIONAL MATCH (p: Student)<-[:HAS_PROCEDURE]-(r:ProcedureCodes)
  • explicitly provide props you cared under p in the first WITH, which will reduce the data being joined/aggregated.

Also, from the profile log you shared, it's not like 5 mins to me. I think the 5 mins was from studio?

@porscheme
Copy link
Author

Also, from the profile log you shared, it's not like 5 mins to me. I think the 5 mins was from studio?
No, Its not from studio. Using python client library.

We use array of size about 200 in the below. its taking about 5 minutes.
'''
MATCH (p:Student)
WHERE id(p) IN [ ... ]
'''

@wey-gu
Copy link
Contributor

wey-gu commented Mar 27, 2023

let's talk in #5403, which seems to be the same topic.

As @yixinglu suggested, some conf changes may help.

Profile log queried from the nebula-console(in ASCII table not in CSV) could be shared there, too.

Thanks!

@Sophie-Xie Sophie-Xie added the duplicate Solution: this issue or pull request already exists label Mar 28, 2023
@github-actions github-actions bot added the process/fixed Process of bug label Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/none PR/issue: this bug affects none version. duplicate Solution: this issue or pull request already exists process/fixed Process of bug severity/none Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

3 participants