You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2021/05/20 14:04:33 UTC

[GitHub] [incubator-age] pdpotter commented on issue #45: unique properties / indexing

pdpotter commented on issue #45:
URL: https://github.com/apache/incubator-age/issues/45#issuecomment-845153669


   I tried using id() instead of using properties for matching, but this was even slower (I noticed using an additional `WHERE` clause instead of defining properties in the `MATCH` clause is slower in another use case as well).
   
   For this, I rewrote
   ```
   SELECT * FROM cypher('graph_name', $$
   MATCH (d:LabelA {id: 1}), (r:LabelB {id: 2})
   CREATE (d)-[:Relation {prop: 'value'}]->(r)
   $$) as (a agtype);
   ```
   to
   ```
   SELECT * FROM cypher('graph_name', $$
   MATCH (d:LabelA), (r:LabelB)
   WHERE id(d) = 11111 and id(r) = 11112
   CREATE (d)-[:Relation {prop: 'value'}]->(r)
   $$) as (a agtype);
   ```
   where I obtained the ids (the ones above are made up) using
   ```
   SELECT * FROM cyper('graph_name',$$
   MATCH (n:LabelA)
   return id(n), n.id
   $$) as (id agtype, prop 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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org