Optimize KuzuDB queries #12

Open
opened 2024-02-21 09:16:28 +00:00 by linus · 1 comment
Owner

Problem. Sometimes queries for big orgs run a long time and then fail. This can be solved with more specific queries. IMHO, we would need one specific query for buyers, e.g:

MATCH (o:Organization)<-[e:hasBuyer]-(n:Release)-[e2:hasContracts|:hasAwards|:hasTender]->(n2)-[e3*0..2]-(o3:Organization),
 (o:Organization)-[i:isSameAs]-(o2:Organization)
WHERE o.id = "a91d4e21-c6d3-53d8-ac1c-1d0a9b9b0c37" and i.probability > 0.9
RETURN o, e, n, e2, n2, i, o2, e3, o3 LIMIT 500

and one similarly specific query for suppliers (for suppliers the current query works quite well actually). Ideally the node/organization/graph/{id} endpoint would find out on its own whether the org is a supplier or a buyer.

Problem. Sometimes queries for big orgs run a long time and then fail. This can be solved with more specific queries. IMHO, we would need one specific query for **buyers**, e.g: ```cypher MATCH (o:Organization)<-[e:hasBuyer]-(n:Release)-[e2:hasContracts|:hasAwards|:hasTender]->(n2)-[e3*0..2]-(o3:Organization), (o:Organization)-[i:isSameAs]-(o2:Organization) WHERE o.id = "a91d4e21-c6d3-53d8-ac1c-1d0a9b9b0c37" and i.probability > 0.9 RETURN o, e, n, e2, n2, i, o2, e3, o3 LIMIT 500 ``` and one similarly specific query for **suppliers** (for suppliers the current query works quite well actually). Ideally the `node/organization/graph/{id}` endpoint would find out on its own whether the org is a supplier or a buyer.
linus added the
Priority
High
label 2024-02-21 09:18:39 +00:00
Author
Owner

I made some improvements to the organization graph endpoint in 970ff445e9

I made some improvements to the organization graph endpoint in 970ff445e96acb6e51ab92aac944db37e4d2c8fa
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TEDective/api#12
No description provided.