MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test05_index_scan

Method test05_index_scan

tests/flow/test_multi_label.py:116–142  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114
115 # Validate behavior of index scans on multi-labeled nodes
116 def test05_index_scan(self):
117
118 query_result = create_node_exact_match_index(graph, 'L1', 'v', sync=True)
119 self.env.assertEquals(query_result.indices_created, 1)
120
121 # Query the explicitly created index
122 query = """MATCH (a:L1) WHERE a.v > 0 RETURN a.v ORDER BY a.v"""
123 plan = graph.execution_plan(query)
124 self.env.assertContains("Index Scan", plan)
125 query_result = graph.query(query)
126 expected_result = [[1],
127 [2],
128 [3]]
129 self.env.assertEquals(query_result.result_set, expected_result)
130
131 # Query the explicitly created index on a multi-labeled node
132 queries = [
133 "MATCH (a:L1:L2) WHERE a.v > 0 RETURN a.v ORDER BY a.v",
134 "MATCH (a:L2:L1) WHERE a.v > 0 RETURN a.v ORDER BY a.v"
135 ]
136
137 for q in queries:
138 plan = graph.execution_plan(q)
139 self.env.assertContains("Index Scan", plan)
140 query_result = graph.query(q)
141 expected_result = [[3]]
142 self.env.assertEquals(query_result.result_set, expected_result)
143
144 # Validate the creation of multi-labeled nodes with the MERGE clause
145 def test06_multi_label_merge(self):

Callers

nothing calls this directly

Calls 3

execution_planMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected