You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by "ajit-satav (via GitHub)" <gi...@apache.org> on 2023/11/22 12:43:09 UTC
[I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
ajit-satav opened a new issue, #1413:
URL: https://github.com/apache/age/issues/1413
While executing variable length query I am getting zero results
SELECT *
FROM cypher('demo', $$
MATCH (a:Employee{name:'xxxx'})-[*]-(b)
RETURN a
$$) as (a agtype);
But if I do execute below query without variable length edges (*) it works and returns results
SELECT *
FROM cypher('demo', $$
MATCH (a:Employee{name:'xxxx'})-[]-(b)
RETURN a
$$) as (a agtype);
Any suggestions why query with * is returning zero results?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1823195376
@ajit-satav
Both with and without `*` produced same result on the latest master.
```
(pg-15.4) agedev=# SELECT *
FROM cypher('demo', $$
MATCH (a:Employee{name:'xxxx'})-[]-(b)
RETURN a
$$) as (a agtype);
a
---------------------------------------------------------------------------------------
{"id": 1125899906842625, "label": "Employee", "properties": {"name": "xxxx"}}::vertex
(1 row)
```
```
(pg-15.4) agedev=# SELECT *
FROM cypher('demo', $$
MATCH (a:Employee{name:'xxxx'})-[*]-(b)
RETURN a
$$) as (a agtype);
a
---------------------------------------------------------------------------------------
{"id": 1125899906842625, "label": "Employee", "properties": {"name": "xxxx"}}::vertex
(1 row)
```
I created the entities using-
```sql
SELECT * FROM cypher ('demo', $$ CREATE (a:Employee{name:'xxxx'})-[:rel]->(b) $$) as (a agtype);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1830700231
@ajit-satav Also, please explain what you mean by "start breaking". Do you mean taking a long time? When you query for variable length edges with just `[*]`, that means all lengths. When you use directionless edges `-[*]-` that means both directions. On a large graph, using both can be intensive depending on how connected the graph is.
Additionally, what version of AGE are you using?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "ajit-satav (via GitHub)" <gi...@apache.org>.
ajit-satav commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1829871947
Sharing dataset will be difficult. But I have observed that queries similar to below start breaking when we have larger number of edges e.g. over 2 million
SELECT *
FROM cypher('demo', $$
MATCH (a:Employee{name:'xxxx'})-[*]-(b)
RETURN a
$$) as (a agtype);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1830678338
@ajit-satav Can you provide an output showing the two queries where one works and the other doesn't? Like what @rafsun42 showed above. Use the <> code option so that we can see that output here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1836730008
@ajit-satav For a VLE MATCH, indexes will have minimal impact on performance.
The reason your query is running long is due to specifying a directionless and unlimited length edge `-[*]-` If you want to improve performance, you will need to put restrictions on it. Even on small graphs, specifying directionless edges along with unlimited length edges can take a long time. This is partly due to PostgreSQL and partly due to graph traversal in general.
Edges in AGE have a direction. By querying with directionless edges, you can dramatically increase the number of paths through vertices and the path finding algorithms needs to find them all.
PostgreSQL, via the command line, will want to finish processing the entire query before outputting paged results. You can use the LIMIT command to force it to stop after a specified number of found values. However, I don't know if there is a way to force it to show results as it finds them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "ajit-satav (via GitHub)" <gi...@apache.org>.
ajit-satav commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1836270177
There was an issue with duplicate records inserted while creating edges. Now after correcting that query with
```MATCH (c1:components{name:'XXXX'})-[e*1]-(c2:versions) ``` working fine.
[data-1701366514145.csv](https://github.com/apache/age/files/13528029/data-1701366514145.csv)
But Query with
```MATCH (c1:components{name:'XXXX'})-[e*]-(c2:versions) ``` taking forever to execute
I have index set on id column for all tables. Is it possible and recommended to set additional indexes on attributes within properties? if yes could you please suggest to how to achieve it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "rafsun42 (via GitHub)" <gi...@apache.org>.
rafsun42 commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1824716062
@ajit-satav Is it possible to share your dataset?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "jimenasansav (via GitHub)" <gi...@apache.org>.
jimenasansav commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1823189736
Hi @ajit-satav! Thank you very much for your question. Our team will look through it and provide an answer soon.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "ajit-satav (via GitHub)" <gi...@apache.org>.
ajit-satav commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1823868318
it is working for me as well with limited number of vertices and edges. Issue appears when I loaded around 500k vertices and 900k edges
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1832145512
@ajit-satav Could you please include the results of the queries along with the queries? In particular, the full output of c1, c2, and the edge. Say, these queries instead -
```
SELECT * from
cypher('demo', $$
MATCH (c1:components{name:'XXXX'})-[e]-(c2:versions)
return c1,c2,e
$$) as (c1 agtype, c2 agtype, e agtype);
SELECT * from
cypher('demo', $$
MATCH (c1:components{name:'XXXX'})-[e*]-(c2:versions)
return c1,c2,e
$$) as (c1 agtype, c2 agtype, e agtype);
```
Just looking at the queries, and not the results (blank or otherwise), doesn't really give us much to go on.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "jrgemignani (via GitHub)" <gi...@apache.org>.
jrgemignani commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-2062464150
@ajit-satav Is this still a problem or is the issue resolved?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-2171948566
This issue is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] AGE Cypher query matching variable length edges with [*] returns zero rows [age]
Posted by "ajit-satav (via GitHub)" <gi...@apache.org>.
ajit-satav commented on issue #1413:
URL: https://github.com/apache/age/issues/1413#issuecomment-1831279859
1. AGE Version - 1.4.0
2. Start breaking means it gives me zero results
e..g
```
SELECT * from
cypher('demo', $$
MATCH (c1:components{name:'XXXX'})-[]-(c2:versions)
return c2.name
$$) as (v agtype);
```
Results - No of c2.name returned - 2
```
SELECT * from
cypher('demo', $$
MATCH (c1:components{name:'XXXX'})-[*]-(c2:versions)
return c2.name
$$) as (v agtype);
```
Results - No of c2.name returned - 0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org