jrgemignani commented on issue #1000:
URL: https://github.com/apache/age/issues/1000#issuecomment-1672342068

   @vladiksun I was able to get an index working for WHERE -
   
   ```
   psql-15.3-5432-pgsql=# select
       any_profile
   from ag_catalog.cypher('test_graph',$$
       EXPLAIN ANALYZE MATCH (any_profile:`profile` { hidden: false })
       WHERE any_profile.pet = 'dog'
       RETURN any_profile
   $$
   ) as (any_profile ag_catalog.agtype);
                                                                                
                                   QUERY PLAN
   
   
------------------------------------------------------------------------------------------------------------------------------------
   
------------------------------------------------------------------------------------------------------
    Bitmap Heap Scan on profile any_profile  (cost=53.67..57.70 rows=1 
width=32) (actual time=69.444..425.885 rows=33347 loops=1)
      Recheck Cond: ((agtype_access_operator(VARIADIC 
ARRAY[_agtype_build_vertex(id, _label_name('16954'::oid, id), properties), 
'"pet"
   '::agtype]) = '"dog"'::agtype) AND (properties @> 
agtype_build_map('hidden'::text, 'false'::agtype)))
      Heap Blocks: exact=2858
      ->  BitmapAnd  (cost=53.67..53.67 rows=1 width=0) (actual 
time=68.563..68.564 rows=0 loops=1)
            ->  Bitmap Index Scan on profile_pet_btree_idx5  (cost=0.00..23.92 
rows=1000 width=0) (actual time=38.343..38.343 rows=6666
   6 loops=1)
                  Index Cond: (agtype_access_operator(VARIADIC 
ARRAY[_agtype_build_vertex(id, _label_name('16954'::oid, id), properties
   ), '"pet"'::agtype]) = '"dog"'::agtype)
            ->  Bitmap Index Scan on profile_gin_idx  (cost=0.00..29.50 
rows=200 width=0) (actual time=29.980..29.980 rows=99961 loops=
   1)
                  Index Cond: (properties @> agtype_build_map('hidden'::text, 
'false'::agtype))
    Planning Time: 1.457 ms
    Execution Time: 430.522 ms
   (10 rows)
   ```
   
   I still need to do other tests to verify that the changes don't cause any 
side effects. There are 2 issues here -
   
   - Are the functions truly IMMUTABLE? This needs to be verified.
   - The `profile_pet_btree_idx3 `was not correct. But, without being able to 
create it, you wouldn't know.


-- 
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-unsubscr...@age.apache.org

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

Reply via email to