(self)
| 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): |
nothing calls this directly
no test coverage detected