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

Bug: Buffer manager exception for simple queries on large data #4943

Open
NeuralFlux opened this issue Feb 21, 2025 · 9 comments · Fixed by #4975
Open

Bug: Buffer manager exception for simple queries on large data #4943

NeuralFlux opened this issue Feb 21, 2025 · 9 comments · Fixed by #4975
Assignees
Labels
bug Something isn't working

Comments

@NeuralFlux
Copy link

NeuralFlux commented Feb 21, 2025

Kùzu version

v0.8.0

What operating system are you using?

MacOS Sequoia 15.2

What happened?

I'm using the Python API. I have sample biomedical data with about 150k nodes and 1 million edges. Most queries I've tried fail with buffer manager exception. Is this expected? Am I hitting the limits of KuzuDB (for my machine)?

Sample queries that work -

MATCH (a) RETURN COUNT(a);  // count total nodes

MATCH (g:Gene) WHERE g.name CONTAINS 'kinase' RETURN g;  // property filtering for a node

Sample queries that fail -

MATCH ()-[r]->() RETURN COUNT(r);  // count total edges

MATCH (n)-[r]-(m) WHERE n.id = 'C0429886' AND m.id = 'C0015943' RETURN r;  // get all edges between 2 nodes

Some more info - I have around 30 node tables and 1800 rel tables, MacBook Pro 3 with 18GB memory

Are there known steps to reproduce?

Here's the Kuzu export in CSV format to help reproduce the errors. semmed_export.zip

@NeuralFlux NeuralFlux added the bug Something isn't working label Feb 21, 2025
@ray6080
Copy link
Contributor

ray6080 commented Feb 21, 2025

hi @NeuralFlux thanks for reporting this. will take a look asap.

@ray6080 ray6080 self-assigned this Feb 21, 2025
@ray6080
Copy link
Contributor

ray6080 commented Feb 21, 2025

hi @NeuralFlux first, let me clarify that you're not hitting the limit of Kuzu 😄 instead this is a performance bug, and thanks for spotting this for us. The bm exception is due to a non-optimized memory usage when scanning from multiple labelled rel tables. We will optimize this away soon. 😄
As a workaround for now, can you try reduce num of threads, e.g., CALL threads=1;, or explicitly specify labels if applicable?

@NeuralFlux
Copy link
Author

Thanks for the quick response, @ray6080 ! Limiting the number of threads did the job. I was mistaken about Kuzu's performance :)

@NeuralFlux
Copy link
Author

If it's not proprietary, may I know how you debugged this? Just curious, it might help sort issues by myself in the future, haha.

@ray6080
Copy link
Contributor

ray6080 commented Feb 26, 2025

If it's not proprietary, may I know how you debugged this? Just curious, it might help sort issues by myself in the future, haha.

Ah, sorry, this slipped my mind. No, it's not proprietary at all. First, we were aware of the potential bottleneck when scanning from multiple labeled relationship tables. So, we did some profiling within our MemoryManager to track where memory is being allocated and used.

@ray6080
Copy link
Contributor

ray6080 commented Feb 28, 2025

@NeuralFlux this should be fixed now on master. Could you try it on our next dev build (0.8.3.dev4)?

@NeuralFlux
Copy link
Author

@ray6080 thanks for the feedback! Sure, I will test it once it's out.

@aracardan
Copy link

Hi @NeuralFlux
I'm Ardan - the CPO of Kuzu. I'm very interested in learning more about how Kuzu is used in Life Sciences in general and bio medicine in particular. My email is ardan@kuzudb.com. If you can email me I'd love to ask you a few questions about your project and of course hear your feedback about Kuzu.

@ray6080
Copy link
Contributor

ray6080 commented Mar 6, 2025

hi @NeuralFlux not sure if you got the chance to test it on your side, but just want to let you know that the dev build is out, and you can pull our latest one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants