ZhengZhanFei commented on issue #2322:
URL: https://github.com/apache/age/issues/2322#issuecomment-3802545142

   First of all, I would like to express my gratitude for your reply, which 
helped me solve this confusion. I was indeed able to temporarily resolve this 
issue by running the command "REINDEX INDEX graph.label_name". However, when I 
finally decided to abandon the use of the gin index, I attempted to use the 
btree index, but encountered the same problem.
   
   The execution steps are as follows:
   
   ```
   SELECT create_graph('graph_name_8');
   
   SELECT create_vlabel('graph_name_8','n1');
   
   create index idx_n1_node_name_btree
   on graph_name_8.n1                 
   using btree                        
   (
     agtype_access_operator(variadic array[properties, '"node_name"'::agtype])
   );
   
   SELECT load_labels_from_file(
     'graph_name_8',
     'n1',
     '/tmp/age/age-node-final.csv'
   );
   ```
   
   -- Query One
   ```
   SELECT *
   FROM cypher('graph_name_8', $$
     explain MATCH (a:n1)
     where a.node_name = 'type2_1'
     RETURN a
   $$) AS (a agtype);
   ```
   
   -- result
   Index Scan using idx_n1_node_name_btree on n1 a  (cost=0.18..8.20 rows=1 
width=32)
     Index Cond: (agtype_access_operator(VARIADIC ARRAY[properties, 
'"node_name"'::agtype]) = '"type2_1"'::agtype)
   
   -- Query Two
   ```
   SELECT *
   FROM cypher('graph_name_8', $$
     MATCH (a:n1 {node_name : 'type2_1'})
     RETURN a
   $$) AS (a agtype);
   ```
   
   -- result
   Gather  (cost=1000.00..53896.65 rows=200 width=32)
     Workers Planned: 2
     ->  Parallel Seq Scan on n1 a  (cost=0.00..52876.65 rows=83 width=32)
           Filter: (properties @> '{"node_name": "type2_1"}'::agtype)
   
   The first query statement utilized a btree index, but failed to retrieve any 
data in the end. In contrast, the second query statement did not use the index 
and was able to retrieve the data.
   
   When I created a btree index for a certain field, the problem of being 
unable to query still occurred (if I did not create the btree index and kept 
the other steps unchanged, I could query normally)
   
   I hope to trouble you again to confirm this matter. Thank you very much.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to