From 74f53369c063c993812b55c82c633b73244bb3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1nos=20Benjamin=20Antal?= Date: Thu, 9 Feb 2023 12:44:34 +0100 Subject: [PATCH] Add two more queries to simple benchmark --- tests/mgbench/datasets.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/mgbench/datasets.py b/tests/mgbench/datasets.py index 83ae28a2e..319b67c17 100644 --- a/tests/mgbench/datasets.py +++ b/tests/mgbench/datasets.py @@ -379,6 +379,24 @@ class AccessControl(Dataset): return query def benchmark__match__match_all_vertices_with_edges(self): - self.next_value_idx += 1 query = ("MATCH (permission:Permission)-[e:IS_FOR_FILE]->(file:File) RETURN *", {}) return query + + def benchmark__match__match_users_with_permission_for_files(self): + file_uuid_1 = self._get_random_uuid("File") + file_uuid_2 = self._get_random_uuid("File") + min_file_uuid = min(file_uuid_1, file_uuid_2) + max_file_uuid = max(file_uuid_1, file_uuid_2) + query = ( + "MATCH (f:File)<-[ff:IS_FOR_FILE]-(p:Permission)-[fi:IS_FOR_IDENTITY]->(i:Identity) WHERE f.uuid >= $min_file_uuid AND f.uuid <= $max_file_uuid RETURN *", + {"min_file_uuid": min_file_uuid, "max_file_uuid": max_file_uuid}, + ) + return query + + def benchmark__match__match_users_with_permission_for_specific_file(self): + file_uuid = self._get_random_uuid("File") + query = ( + "MATCH (f:File {uuid: $file_uuid})<-[ff:IS_FOR_FILE]-(p:Permission)-[fi:IS_FOR_IDENTITY]->(i:Identity) RETURN *", + {"file_uuid": file_uuid}, + ) + return query