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 2022/06/07 12:36:07 UTC

[GitHub] [incubator-age] pdpotter opened a new issue, #228: Match queries with integer properties constraints return 0 results after adding gin index

pdpotter opened a new issue, #228:
URL: https://github.com/apache/incubator-age/issues/228

   **Describe the bug**
   When a GIN index is added to the properties of a vertex, MATCH queries with a constraint on an integer property return 0 results.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   - psql
   
   **What data setup do we need to do?**
   ```pgsql
   SELECT * FROM cypher('cypher_index', $$CREATE (p:Person {id: 1, name: 'John'}) return p$$) as (p agtype);
   CREATE INDEX props on cypher_index."Person" USING GIN (properties);
   SET enable_seqscan=false;
   ```
   
   **What is the necessary configuration info needed?**
   - /
   
   **What is the command that caused the error?**
   ```pgsql
   SELECT * FROM cypher('cypher_index', $$MATCH (p:Person {id: 1}) return p$$) as (p agtype);
    p 
   ---
   (0 rows)
   ```
   
   **Expected behavior**
   One row should be returned
   
   **Environment (please complete the following information):**
   - Version: https://github.com/apache/incubator-age/commit/d5cd56883da75bcf6d85f85b71f169cc5421a325
   
   **Additional context**
   This bug is a minimal reproduction of the issue described in https://github.com/apache/incubator-age/issues/45#issuecomment-1121484835
   
   The same query wih a constraint on a string property gives correct results:
   ```
   SELECT * FROM cypher('cypher_index', $$MATCH (p:Person {name: 'John'}) return p$$) as (p agtype);
                                                 p                                              
   ---------------------------------------------------------------------------------------------
    {"id": 844424930131969, "label": "Person", "properties": {"id": 1, "name": "John"}}::vertex
   (1 row)
   ```
   
   Explain for the integer property constraint:
   ```
   SELECT * FROM cypher('cypher_index', $$EXPLAIN MATCH (p:Person {id: 1}) return p$$) as (p agtype);
                                     QUERY PLAN                                   
   -------------------------------------------------------------------------------
    Bitmap Heap Scan on "Person" p  (cost=12.00..16.02 rows=1 width=32)
      Recheck Cond: (properties @> agtype_build_map('id'::text, '1'::agtype))
      ->  Bitmap Index Scan on props  (cost=0.00..12.00 rows=1 width=0)
            Index Cond: (properties @> agtype_build_map('id'::text, '1'::agtype))
   (4 rows)
   ```
   
   Explain for the string property constraint:
   ```
   SELECT * FROM cypher('cypher_index', $$EXPLAIN MATCH (p:Person {name: 'John'}) return p$$) as (p agtype);
                                         QUERY PLAN                                      
   --------------------------------------------------------------------------------------
    Bitmap Heap Scan on "Person" p  (cost=12.00..16.02 rows=1 width=32)
      Recheck Cond: (properties @> agtype_build_map('name'::text, '"John"'::agtype))
      ->  Bitmap Index Scan on props  (cost=0.00..12.00 rows=1 width=0)
            Index Cond: (properties @> agtype_build_map('name'::text, '"John"'::agtype))
   (4 rows)
   ```


-- 
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


[GitHub] [age] pdpotter commented on issue #228: Match queries with integer properties constraints return 0 results after adding gin index

Posted by GitBox <gi...@apache.org>.
pdpotter commented on issue #228:
URL: https://github.com/apache/age/issues/228#issuecomment-1210509638

   This issue has been fixed in https://github.com/apache/age/commit/392a937bdfa7c7a869798d7dca93f250c94d42e9.


-- 
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


[GitHub] [age] pdpotter closed issue #228: Match queries with integer properties constraints return 0 results after adding gin index

Posted by GitBox <gi...@apache.org>.
pdpotter closed issue #228: Match queries with integer properties constraints return 0 results after adding gin index
URL: https://github.com/apache/age/issues/228


-- 
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