Implement edge type indices (#1542)
Implement edge type indices (#1542 )
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// --storage-items-per-batch is set to 10
|
||||
CREATE INDEX ON :`label2`(`prop2`);
|
||||
CREATE INDEX ON :`label2`(`prop`);
|
||||
CREATE INDEX ON :`label`;
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE EDGE INDEX ON :`edge_type`;
|
||||
CREATE (:`edge_index_from`), (:`edge_index_to`);
|
||||
MATCH (n:`edge_index_from`), (m:`edge_index_to`) CREATE (n)-[r:`edge_type`]->(m);
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 0, `prop2`: ["kaj", 2, Null, {`prop4`: -1.341}], `ext`: 2, `prop`: "joj"});
|
||||
CREATE (:__mg_vertex__:`label2`:`label` {__mg_id__: 1, `ext`: 2, `prop`: "joj"});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 2, `prop2`: 2, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 3, `prop2`: 2, `prop`: 2});
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 1 AND v.__mg_id__ = 0 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 1 AND v.__mg_id__ = 1 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 1 AND v.__mg_id__ = 2 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 1 AND v.__mg_id__ = 3 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT EXISTS (u.`ext`);
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT u.`prop2`, u.`prop` IS UNIQUE;
|
||||
ANALYZE GRAPH;
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
DROP EDGE INDEX ON :`edge_type`;
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE (:__mg_vertex__:`edge_index_from` {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__:`edge_index_to` {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 2, `prop2`: ["kaj", 2, Null, {`prop4`: -1.341}], `ext`: 2, `prop`: "joj"});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 4, `prop2`: 2, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 5, `prop2`: 2, `prop`: 2});
|
||||
CREATE (:__mg_vertex__:`label`:`label2` {__mg_id__: 3, `ext`: 2, `prop`: "joj"});
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT u.`prop2`, u.`prop` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT EXISTS (u.`ext`);
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE INDEX ON :`label2`(`prop2`);
|
||||
CREATE INDEX ON :`label2`(`prop`);
|
||||
CREATE INDEX ON :`label`;
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 0 AND v.__mg_id__ = 1 CREATE (u)-[:`edge_type`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 2 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 3 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 4 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 5 CREATE (u)-[:`link` {`ext`: [false, {`k`: "l"}], `prop`: -1}]->(v);
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE (:__mg_vertex__:`edge_index_from` {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__:`edge_index_to` {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 2, `prop2`: ["kaj", 2, Null, {`prop4`: -1.341}], `prop`: "joj", `ext`: 2});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 4, `prop2`: 2, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 5, `prop2`: 2, `prop`: 2});
|
||||
CREATE (:__mg_vertex__:`label`:`label2` {__mg_id__: 3, `prop`: "joj", `ext`: 2});
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT u.`prop2`, u.`prop` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT EXISTS (u.`ext`);
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE INDEX ON :`label2`(`prop2`);
|
||||
CREATE INDEX ON :`label2`(`prop`);
|
||||
CREATE INDEX ON :`label`;
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 0 AND v.__mg_id__ = 1 CREATE (u)-[:`edge_type`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 2 CREATE (u)-[:`link` {`prop`: -1, `ext`: [false, {`k`: "l"}]}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 3 CREATE (u)-[:`link` {`prop`: -1, `ext`: [false, {`k`: "l"}]}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 4 CREATE (u)-[:`link` {`prop`: -1, `ext`: [false, {`k`: "l"}]}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 3 AND v.__mg_id__ = 5 CREATE (u)-[:`link` {`prop`: -1, `ext`: [false, {`k`: "l"}]}]->(v);
|
||||
BIN
tests/integration/durability/tests/v17/test_all/snapshot.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_all/snapshot.bin
Normal file
Binary file not shown.
BIN
tests/integration/durability/tests/v17/test_all/wal.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_all/wal.bin
Normal file
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT EXISTS (u.`ext2`);
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT EXISTS (u.`ext`);
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`a` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`b` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`c` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT u.`a`, u.`b` IS UNIQUE;
|
||||
@@ -0,0 +1,6 @@
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT EXISTS (u.`ext2`);
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT EXISTS (u.`ext`);
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`c` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`b` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`a` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT u.`b`, u.`a` IS UNIQUE;
|
||||
@@ -0,0 +1,6 @@
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT EXISTS (u.`ext2`);
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT EXISTS (u.`ext`);
|
||||
CREATE CONSTRAINT ON (u:`label2`) ASSERT u.`a`, u.`b` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`a` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`b` IS UNIQUE;
|
||||
CREATE CONSTRAINT ON (u:`label`) ASSERT u.`c` IS UNIQUE;
|
||||
Binary file not shown.
BIN
tests/integration/durability/tests/v17/test_constraints/wal.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_constraints/wal.bin
Normal file
Binary file not shown.
@@ -0,0 +1,60 @@
|
||||
// --storage-items-per-batch is set to 7
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 2});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 3});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 4});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 5});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 6});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 7});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 8});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 9});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 10});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 11});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 12});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 13});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 14});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 15});
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 0 AND v.__mg_id__ = 1 CREATE (u)-[:`edge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 2 AND v.__mg_id__ = 3 CREATE (u)-[:`edge` {`prop`: 11}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 4 AND v.__mg_id__ = 5 CREATE (u)-[:`edge` {`prop`: true}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 6 AND v.__mg_id__ = 7 CREATE (u)-[:`edge2`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 8 AND v.__mg_id__ = 9 CREATE (u)-[:`edge2` {`prop`: -3.141}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 10 AND v.__mg_id__ = 11 CREATE (u)-[:`edgelink` {`prop`: {`prop`: 1, `prop2`: {`prop4`: 9}}}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 12 AND v.__mg_id__ = 13 CREATE (u)-[:`edgelink` {`prop`: [1, Null, false, "\n\n\n\n\\\"\"\n\t"]}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 0 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 1 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 2 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 3 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 4 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 5 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 6 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 7 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 8 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 9 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 10 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 11 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 12 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 13 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 14 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 15 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 0 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 1 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 2 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 3 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 4 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 5 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 6 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 7 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 8 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 9 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 10 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 11 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 12 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 13 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 14 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 15 CREATE (u)-[:`testedge`]->(v);
|
||||
ANALYZE GRAPH;
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
@@ -0,0 +1,58 @@
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 2});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 3});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 4});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 5});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 6});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 7});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 8});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 9});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 10});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 11});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 12});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 13});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 14});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 15});
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 0 AND v.__mg_id__ = 1 CREATE (u)-[:`edge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 2 AND v.__mg_id__ = 3 CREATE (u)-[:`edge` {`prop`: 11}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 4 AND v.__mg_id__ = 5 CREATE (u)-[:`edge` {`prop`: true}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 6 AND v.__mg_id__ = 7 CREATE (u)-[:`edge2`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 8 AND v.__mg_id__ = 9 CREATE (u)-[:`edge2` {`prop`: -3.141}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 10 AND v.__mg_id__ = 11 CREATE (u)-[:`edgelink` {`prop`: {`prop`: 1, `prop2`: {`prop4`: 9}}}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 12 AND v.__mg_id__ = 13 CREATE (u)-[:`edgelink` {`prop`: [1, Null, false, "\n\n\n\n\\\"\"\n\t"]}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 0 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 1 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 2 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 3 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 4 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 5 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 6 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 7 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 8 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 9 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 10 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 11 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 12 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 13 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 14 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 15 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 0 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 1 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 2 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 3 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 4 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 5 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 6 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 7 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 8 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 9 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 10 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 11 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 12 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 13 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 14 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 15 CREATE (u)-[:`testedge`]->(v);
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
@@ -0,0 +1,58 @@
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 2});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 3});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 4});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 5});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 6});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 7});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 8});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 9});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 10});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 11});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 12});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 13});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 14});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 15});
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 0 AND v.__mg_id__ = 1 CREATE (u)-[:`edge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 2 AND v.__mg_id__ = 3 CREATE (u)-[:`edge` {`prop`: 11}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 4 AND v.__mg_id__ = 5 CREATE (u)-[:`edge` {`prop`: true}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 6 AND v.__mg_id__ = 7 CREATE (u)-[:`edge2`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 8 AND v.__mg_id__ = 9 CREATE (u)-[:`edge2` {`prop`: -3.141}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 10 AND v.__mg_id__ = 11 CREATE (u)-[:`edgelink` {`prop`: {`prop`: 1, `prop2`: {`prop4`: 9}}}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 12 AND v.__mg_id__ = 13 CREATE (u)-[:`edgelink` {`prop`: [1, Null, false, "\n\n\n\n\\\"\"\n\t"]}]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 0 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 1 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 2 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 3 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 4 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 5 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 6 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 7 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 8 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 9 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 10 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 11 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 12 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 13 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 14 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 14 AND v.__mg_id__ = 15 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 0 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 1 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 2 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 3 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 4 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 5 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 6 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 7 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 8 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 9 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 10 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 11 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 12 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 13 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 14 CREATE (u)-[:`testedge`]->(v);
|
||||
MATCH (u:__mg_vertex__), (v:__mg_vertex__) WHERE u.__mg_id__ = 15 AND v.__mg_id__ = 15 CREATE (u)-[:`testedge`]->(v);
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
BIN
tests/integration/durability/tests/v17/test_edges/snapshot.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_edges/snapshot.bin
Normal file
Binary file not shown.
BIN
tests/integration/durability/tests/v17/test_edges/wal.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_edges/wal.bin
Normal file
Binary file not shown.
@@ -0,0 +1,6 @@
|
||||
CREATE INDEX ON :`label2`;
|
||||
CREATE INDEX ON :`label2`(`prop2`);
|
||||
CREATE INDEX ON :`label`(`prop2`);
|
||||
CREATE INDEX ON :`label`(`prop`);
|
||||
CREATE EDGE INDEX ON :`edgetype`;
|
||||
ANALYZE GRAPH;
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE INDEX ON :`label2`;
|
||||
CREATE INDEX ON :`label`(`prop`);
|
||||
CREATE INDEX ON :`label`(`prop2`);
|
||||
CREATE INDEX ON :`label2`(`prop2`);
|
||||
CREATE EDGE INDEX ON :`edgetype`;
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE INDEX ON :`label2`;
|
||||
CREATE INDEX ON :`label2`(`prop2`);
|
||||
CREATE INDEX ON :`label`(`prop2`);
|
||||
CREATE INDEX ON :`label`(`prop`);
|
||||
CREATE EDGE INDEX ON :`edgetype`;
|
||||
BIN
tests/integration/durability/tests/v17/test_indices/snapshot.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_indices/snapshot.bin
Normal file
Binary file not shown.
BIN
tests/integration/durability/tests/v17/test_indices/wal.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_indices/wal.bin
Normal file
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
// --storage-items-per-batch is set to 5
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 2, `prop`: false});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 3, `prop`: true});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 4, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 5, `prop2`: 3.141});
|
||||
CREATE (:__mg_vertex__:`label6` {__mg_id__: 6, `prop3`: true, `prop2`: -314000000});
|
||||
CREATE (:__mg_vertex__:`label3`:`label1`:`label2` {__mg_id__: 7});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 8, `prop3`: "str", `prop2`: 2, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label2`:`label1` {__mg_id__: 9, `prop`: {`prop_nes`: "kaj je"}});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 10, `prop_array`: [1, false, Null, "str", {`prop2`: 2}]});
|
||||
CREATE (:__mg_vertex__:`label3`:`label` {__mg_id__: 11, `prop`: {`prop`: [1, false], `prop2`: {}, `prop3`: "test2", `prop4`: "test"}});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 12, `prop`: " \n\"\'\t\\%"});
|
||||
ANALYZE GRAPH;
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
@@ -0,0 +1,16 @@
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 2, `prop`: false});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 3, `prop`: true});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 4, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 5, `prop2`: 3.141});
|
||||
CREATE (:__mg_vertex__:`label6` {__mg_id__: 6, `prop3`: true, `prop2`: -314000000});
|
||||
CREATE (:__mg_vertex__:`label2`:`label3`:`label1` {__mg_id__: 7});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 8, `prop3`: "str", `prop2`: 2, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label1`:`label2` {__mg_id__: 9, `prop`: {`prop_nes`: "kaj je"}});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 10, `prop_array`: [1, false, Null, "str", {`prop2`: 2}]});
|
||||
CREATE (:__mg_vertex__:`label`:`label3` {__mg_id__: 11, `prop`: {`prop`: [1, false], `prop2`: {}, `prop3`: "test2", `prop4`: "test"}});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 12, `prop`: " \n\"\'\t\\%"});
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
@@ -0,0 +1,16 @@
|
||||
CREATE INDEX ON :__mg_vertex__(__mg_id__);
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 0});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 1});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 2, `prop`: false});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 3, `prop`: true});
|
||||
CREATE (:__mg_vertex__:`label2` {__mg_id__: 4, `prop`: 1});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 5, `prop2`: 3.141});
|
||||
CREATE (:__mg_vertex__:`label6` {__mg_id__: 6, `prop2`: -314000000, `prop3`: true});
|
||||
CREATE (:__mg_vertex__:`label2`:`label3`:`label1` {__mg_id__: 7});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 8, `prop`: 1, `prop2`: 2, `prop3`: "str"});
|
||||
CREATE (:__mg_vertex__:`label1`:`label2` {__mg_id__: 9, `prop`: {`prop_nes`: "kaj je"}});
|
||||
CREATE (:__mg_vertex__:`label` {__mg_id__: 10, `prop_array`: [1, false, Null, "str", {`prop2`: 2}]});
|
||||
CREATE (:__mg_vertex__:`label`:`label3` {__mg_id__: 11, `prop`: {`prop`: [1, false], `prop2`: {}, `prop3`: "test2", `prop4`: "test"}});
|
||||
CREATE (:__mg_vertex__ {__mg_id__: 12, `prop`: " \n\"\'\t\\%"});
|
||||
DROP INDEX ON :__mg_vertex__(__mg_id__);
|
||||
MATCH (u) REMOVE u:__mg_vertex__, u.__mg_id__;
|
||||
Binary file not shown.
BIN
tests/integration/durability/tests/v17/test_vertices/wal.bin
Normal file
BIN
tests/integration/durability/tests/v17/test_vertices/wal.bin
Normal file
Binary file not shown.
@@ -214,6 +214,8 @@ class InteractiveDbAccessor {
|
||||
return label_property_index_.at(key);
|
||||
}
|
||||
|
||||
bool EdgeTypeIndexExists(memgraph::storage::EdgeTypeId edge_type) { return true; }
|
||||
|
||||
std::optional<memgraph::storage::LabelIndexStats> GetIndexStats(const memgraph::storage::LabelId label) const {
|
||||
return dba_->GetIndexStats(label);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2023 Memgraph Ltd.
|
||||
// Copyright 2024 Memgraph Ltd.
|
||||
//
|
||||
// Use of this software is governed by the Business Source License
|
||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2023 Memgraph Ltd.
|
||||
// Copyright 2024 Memgraph Ltd.
|
||||
//
|
||||
// Use of this software is governed by the Business Source License
|
||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||
@@ -808,13 +808,68 @@ TYPED_TEST(TestPlanner, MatchWhereBeforeExpand) {
|
||||
CheckPlan(planner.plan(), symbol_table, ExpectScanAll(), ExpectFilter(), ExpectExpand(), ExpectProduce());
|
||||
}
|
||||
|
||||
TYPED_TEST(TestPlanner, MatchEdgeTypeIndex) {
|
||||
FakeDbAccessor dba;
|
||||
auto indexed_edge_type = dba.EdgeType("indexed_edgetype");
|
||||
dba.SetIndexCount(indexed_edge_type, 1);
|
||||
{
|
||||
// Test MATCH ()-[r:indexed_edgetype]->() RETURN r;
|
||||
auto *query = QUERY(SINGLE_QUERY(
|
||||
MATCH(PATTERN(NODE("anon1"), EDGE("r", memgraph::query::EdgeAtom::Direction::OUT, {"indexed_edgetype"}),
|
||||
NODE("anon2"))),
|
||||
RETURN("r")));
|
||||
auto symbol_table = memgraph::query::MakeSymbolTable(query);
|
||||
auto planner = MakePlanner<TypeParam>(&dba, this->storage, symbol_table, query);
|
||||
CheckPlan(planner.plan(), symbol_table, ExpectScanAllByEdgeType(), ExpectProduce());
|
||||
}
|
||||
{
|
||||
// Test MATCH (a)-[r:indexed_edgetype]->() RETURN r;
|
||||
auto *query = QUERY(SINGLE_QUERY(
|
||||
MATCH(PATTERN(NODE("a"), EDGE("r", memgraph::query::EdgeAtom::Direction::OUT, {"indexed_edgetype"}),
|
||||
NODE("anon2"))),
|
||||
RETURN("r")));
|
||||
auto symbol_table = memgraph::query::MakeSymbolTable(query);
|
||||
auto planner = MakePlanner<TypeParam>(&dba, this->storage, symbol_table, query);
|
||||
CheckPlan(planner.plan(), symbol_table, ExpectScanAll(), ExpectExpand(), ExpectProduce());
|
||||
}
|
||||
{
|
||||
// Test MATCH ()-[r:indexed_edgetype]->(b) RETURN r;
|
||||
auto *query = QUERY(SINGLE_QUERY(
|
||||
MATCH(PATTERN(NODE("anon1"), EDGE("r", memgraph::query::EdgeAtom::Direction::OUT, {"indexed_edgetype"}),
|
||||
NODE("b"))),
|
||||
RETURN("r")));
|
||||
auto symbol_table = memgraph::query::MakeSymbolTable(query);
|
||||
auto planner = MakePlanner<TypeParam>(&dba, this->storage, symbol_table, query);
|
||||
CheckPlan(planner.plan(), symbol_table, ExpectScanAll(), ExpectExpand(), ExpectProduce());
|
||||
}
|
||||
{
|
||||
// Test MATCH (a)-[r:indexed_edgetype]->(b) RETURN r;
|
||||
auto *query = QUERY(SINGLE_QUERY(
|
||||
MATCH(
|
||||
PATTERN(NODE("a"), EDGE("r", memgraph::query::EdgeAtom::Direction::OUT, {"indexed_edgetype"}), NODE("b"))),
|
||||
RETURN("r")));
|
||||
auto symbol_table = memgraph::query::MakeSymbolTable(query);
|
||||
auto planner = MakePlanner<TypeParam>(&dba, this->storage, symbol_table, query);
|
||||
CheckPlan(planner.plan(), symbol_table, ExpectScanAll(), ExpectExpand(), ExpectProduce());
|
||||
}
|
||||
{
|
||||
// Test MATCH ()-[r:not_indexed_edgetype]->() RETURN r;
|
||||
auto *query = QUERY(SINGLE_QUERY(
|
||||
MATCH(PATTERN(NODE("anon1"), EDGE("r", memgraph::query::EdgeAtom::Direction::OUT, {"not_indexed_edgetype"}),
|
||||
NODE("anon2"))),
|
||||
RETURN("r")));
|
||||
auto symbol_table = memgraph::query::MakeSymbolTable(query);
|
||||
auto planner = MakePlanner<TypeParam>(&dba, this->storage, symbol_table, query);
|
||||
CheckPlan(planner.plan(), symbol_table, ExpectScanAll(), ExpectExpand(), ExpectProduce());
|
||||
}
|
||||
}
|
||||
|
||||
TYPED_TEST(TestPlanner, MatchFilterPropIsNotNull) {
|
||||
FakeDbAccessor dba;
|
||||
auto label = dba.Label("label");
|
||||
auto prop = PROPERTY_PAIR(dba, "prop");
|
||||
dba.SetIndexCount(label, 1);
|
||||
dba.SetIndexCount(label, prop.second, 1);
|
||||
|
||||
{
|
||||
// Test MATCH (n :label) -[r]- (m) WHERE n.prop IS NOT NULL RETURN n
|
||||
auto *query = QUERY(SINGLE_QUERY(MATCH(PATTERN(NODE("n", "label"), EDGE("r"), NODE("m"))),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2023 Memgraph Ltd.
|
||||
// Copyright 2024 Memgraph Ltd.
|
||||
//
|
||||
// Use of this software is governed by the Business Source License
|
||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||
@@ -65,6 +65,7 @@ class PlanChecker : public virtual HierarchicalLogicalOperatorVisitor {
|
||||
PRE_VISIT(ScanAllByLabelPropertyValue);
|
||||
PRE_VISIT(ScanAllByLabelPropertyRange);
|
||||
PRE_VISIT(ScanAllByLabelProperty);
|
||||
PRE_VISIT(ScanAllByEdgeType);
|
||||
PRE_VISIT(ScanAllById);
|
||||
PRE_VISIT(Expand);
|
||||
PRE_VISIT(ExpandVariable);
|
||||
@@ -170,6 +171,7 @@ using ExpectCreateExpand = OpChecker<CreateExpand>;
|
||||
using ExpectDelete = OpChecker<Delete>;
|
||||
using ExpectScanAll = OpChecker<ScanAll>;
|
||||
using ExpectScanAllByLabel = OpChecker<ScanAllByLabel>;
|
||||
using ExpectScanAllByEdgeType = OpChecker<ScanAllByEdgeType>;
|
||||
using ExpectScanAllById = OpChecker<ScanAllById>;
|
||||
using ExpectExpand = OpChecker<Expand>;
|
||||
using ExpectConstructNamedPath = OpChecker<ConstructNamedPath>;
|
||||
@@ -560,6 +562,12 @@ class FakeDbAccessor {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t EdgesCount(memgraph::storage::EdgeTypeId edge_type) const {
|
||||
auto found = edge_type_index_.find(edge_type);
|
||||
if (found != edge_type_index_.end()) return found->second;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool LabelIndexExists(memgraph::storage::LabelId label) const {
|
||||
return label_index_.find(label) != label_index_.end();
|
||||
}
|
||||
@@ -573,6 +581,10 @@ class FakeDbAccessor {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool EdgeTypeIndexExists(memgraph::storage::EdgeTypeId edge_type) const {
|
||||
return edge_type_index_.find(edge_type) != edge_type_index_.end();
|
||||
}
|
||||
|
||||
std::optional<memgraph::storage::LabelPropertyIndexStats> GetIndexStats(
|
||||
const memgraph::storage::LabelId label, const memgraph::storage::PropertyId property) const {
|
||||
return memgraph::storage::LabelPropertyIndexStats{.statistic = 0, .avg_group_size = 1}; // unique id
|
||||
@@ -594,6 +606,8 @@ class FakeDbAccessor {
|
||||
label_property_index_.emplace_back(label, property, count);
|
||||
}
|
||||
|
||||
void SetIndexCount(memgraph::storage::EdgeTypeId edge_type, int64_t count) { edge_type_index_[edge_type] = count; }
|
||||
|
||||
memgraph::storage::LabelId NameToLabel(const std::string &name) {
|
||||
auto found = labels_.find(name);
|
||||
if (found != labels_.end()) return found->second;
|
||||
@@ -608,6 +622,8 @@ class FakeDbAccessor {
|
||||
return edge_types_.emplace(name, memgraph::storage::EdgeTypeId::FromUint(edge_types_.size())).first->second;
|
||||
}
|
||||
|
||||
memgraph::storage::EdgeTypeId EdgeType(const std::string &name) { return NameToEdgeType(name); }
|
||||
|
||||
memgraph::storage::PropertyId NameToProperty(const std::string &name) {
|
||||
auto found = properties_.find(name);
|
||||
if (found != properties_.end()) return found->second;
|
||||
@@ -632,6 +648,7 @@ class FakeDbAccessor {
|
||||
|
||||
std::unordered_map<memgraph::storage::LabelId, int64_t> label_index_;
|
||||
std::vector<std::tuple<memgraph::storage::LabelId, memgraph::storage::PropertyId, int64_t>> label_property_index_;
|
||||
std::unordered_map<memgraph::storage::EdgeTypeId, int64_t> edge_type_index_;
|
||||
};
|
||||
|
||||
} // namespace memgraph::query::plan
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2023 Memgraph Ltd.
|
||||
// Copyright 2024 Memgraph Ltd.
|
||||
//
|
||||
// Use of this software is governed by the Business Source License
|
||||
// included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||
@@ -337,6 +337,7 @@ TEST_F(DecoderEncoderTest, PropertyValueInvalidMarker) {
|
||||
case memgraph::storage::durability::Marker::SECTION_CONSTRAINTS:
|
||||
case memgraph::storage::durability::Marker::SECTION_DELTA:
|
||||
case memgraph::storage::durability::Marker::SECTION_EPOCH_HISTORY:
|
||||
case memgraph::storage::durability::Marker::SECTION_EDGE_INDICES:
|
||||
case memgraph::storage::durability::Marker::SECTION_OFFSETS:
|
||||
case memgraph::storage::durability::Marker::DELTA_VERTEX_CREATE:
|
||||
case memgraph::storage::durability::Marker::DELTA_VERTEX_DELETE:
|
||||
@@ -355,6 +356,8 @@ TEST_F(DecoderEncoderTest, PropertyValueInvalidMarker) {
|
||||
case memgraph::storage::durability::Marker::DELTA_LABEL_PROPERTY_INDEX_DROP:
|
||||
case memgraph::storage::durability::Marker::DELTA_LABEL_PROPERTY_INDEX_STATS_SET:
|
||||
case memgraph::storage::durability::Marker::DELTA_LABEL_PROPERTY_INDEX_STATS_CLEAR:
|
||||
case memgraph::storage::durability::Marker::DELTA_EDGE_TYPE_INDEX_CREATE:
|
||||
case memgraph::storage::durability::Marker::DELTA_EDGE_TYPE_INDEX_DROP:
|
||||
case memgraph::storage::durability::Marker::DELTA_EXISTENCE_CONSTRAINT_CREATE:
|
||||
case memgraph::storage::durability::Marker::DELTA_EXISTENCE_CONSTRAINT_DROP:
|
||||
case memgraph::storage::durability::Marker::DELTA_UNIQUE_CONSTRAINT_CREATE:
|
||||
|
||||
@@ -69,6 +69,7 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
ONLY_EXTENDED,
|
||||
ONLY_EXTENDED_WITH_BASE_INDICES_AND_CONSTRAINTS,
|
||||
BASE_WITH_EXTENDED,
|
||||
BASE_WITH_EDGE_TYPE_INDEXED,
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -270,6 +271,15 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
if (single_transaction) ASSERT_FALSE(acc->Commit().HasError());
|
||||
}
|
||||
|
||||
void CreateEdgeIndex(memgraph::storage::Storage *store, memgraph::storage::EdgeTypeId edge_type) {
|
||||
{
|
||||
// Create edge-type index.
|
||||
auto unique_acc = store->UniqueAccess(ReplicationRole::MAIN);
|
||||
ASSERT_FALSE(unique_acc->CreateIndex(edge_type).HasError());
|
||||
ASSERT_FALSE(unique_acc->Commit().HasError());
|
||||
}
|
||||
}
|
||||
|
||||
void VerifyDataset(memgraph::storage::Storage *store, DatasetType type, bool properties_on_edges,
|
||||
bool verify_info = true) {
|
||||
auto base_label_indexed = store->NameToLabel("base_indexed");
|
||||
@@ -310,13 +320,19 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
UnorderedElementsAre(std::make_pair(base_label_indexed, property_id),
|
||||
std::make_pair(extended_label_indexed, property_count)));
|
||||
break;
|
||||
case DatasetType::BASE_WITH_EDGE_TYPE_INDEXED:
|
||||
ASSERT_THAT(info.label, UnorderedElementsAre(base_label_unindexed));
|
||||
ASSERT_THAT(info.label_property, UnorderedElementsAre(std::make_pair(base_label_indexed, property_id)));
|
||||
ASSERT_THAT(info.edge_type, UnorderedElementsAre(et1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Verify index statistics
|
||||
{
|
||||
switch (type) {
|
||||
case DatasetType::ONLY_BASE: {
|
||||
case DatasetType::ONLY_BASE:
|
||||
case DatasetType::BASE_WITH_EDGE_TYPE_INDEXED: {
|
||||
const auto l_stats = acc->GetIndexStats(base_label_unindexed);
|
||||
ASSERT_TRUE(l_stats);
|
||||
ASSERT_EQ(l_stats->count, 1);
|
||||
@@ -379,6 +395,7 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
auto info = acc->ListAllConstraints();
|
||||
switch (type) {
|
||||
case DatasetType::ONLY_BASE:
|
||||
case DatasetType::BASE_WITH_EDGE_TYPE_INDEXED:
|
||||
ASSERT_THAT(info.existence, UnorderedElementsAre(std::make_pair(base_label_unindexed, property_id)));
|
||||
ASSERT_THAT(info.unique, UnorderedElementsAre(
|
||||
std::make_pair(base_label_unindexed, std::set{property_id, property_extra})));
|
||||
@@ -402,6 +419,7 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
|
||||
bool have_base_dataset = false;
|
||||
bool have_extended_dataset = false;
|
||||
bool have_edge_type_indexed_dataset = false;
|
||||
switch (type) {
|
||||
case DatasetType::ONLY_BASE:
|
||||
case DatasetType::ONLY_BASE_WITH_EXTENDED_INDICES_AND_CONSTRAINTS:
|
||||
@@ -415,6 +433,9 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
have_base_dataset = true;
|
||||
have_extended_dataset = true;
|
||||
break;
|
||||
case DatasetType::BASE_WITH_EDGE_TYPE_INDEXED:
|
||||
have_base_dataset = true;
|
||||
have_edge_type_indexed_dataset = true;
|
||||
}
|
||||
|
||||
// Verify base dataset.
|
||||
@@ -675,6 +696,19 @@ class DurabilityTest : public ::testing::TestWithParam<bool> {
|
||||
}
|
||||
}
|
||||
|
||||
if (have_edge_type_indexed_dataset) {
|
||||
MG_ASSERT(properties_on_edges, "Edge-type indexing needs --properties-on-edges!");
|
||||
// Verify edge-type indices.
|
||||
{
|
||||
std::vector<memgraph::storage::EdgeAccessor> edges;
|
||||
edges.reserve(kNumBaseEdges / 2);
|
||||
for (auto edge : acc->Edges(et1, memgraph::storage::View::OLD)) {
|
||||
edges.push_back(edge);
|
||||
}
|
||||
ASSERT_EQ(edges.size(), kNumBaseEdges / 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (verify_info) {
|
||||
auto info = store->GetBaseInfo();
|
||||
if (have_base_dataset) {
|
||||
@@ -2972,3 +3006,42 @@ TEST_P(DurabilityTest, ConstraintsRecoveryFunctionSetting) {
|
||||
&variant_existence_constraint_creation_func);
|
||||
MG_ASSERT(pval_existence, "Chose wrong type of function for recovery of existence constraint data");
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TEST_P(DurabilityTest, EdgeTypeIndexRecovered) {
|
||||
if (GetParam() == false) {
|
||||
return;
|
||||
}
|
||||
// Create snapshot.
|
||||
{
|
||||
memgraph::storage::Config config{.salient.items = {.properties_on_edges = GetParam()},
|
||||
.durability = {.storage_directory = storage_directory, .snapshot_on_exit = true}};
|
||||
memgraph::replication::ReplicationState repl_state{memgraph::storage::ReplicationStateRootPath(config)};
|
||||
memgraph::dbms::Database db{config, repl_state};
|
||||
CreateBaseDataset(db.storage(), GetParam());
|
||||
VerifyDataset(db.storage(), DatasetType::ONLY_BASE, GetParam());
|
||||
CreateEdgeIndex(db.storage(), db.storage()->NameToEdgeType("base_et1"));
|
||||
VerifyDataset(db.storage(), DatasetType::BASE_WITH_EDGE_TYPE_INDEXED, GetParam());
|
||||
}
|
||||
|
||||
ASSERT_EQ(GetSnapshotsList().size(), 1);
|
||||
ASSERT_EQ(GetBackupSnapshotsList().size(), 0);
|
||||
ASSERT_EQ(GetWalsList().size(), 0);
|
||||
ASSERT_EQ(GetBackupWalsList().size(), 0);
|
||||
|
||||
// Recover snapshot.
|
||||
memgraph::storage::Config config{.salient.items = {.properties_on_edges = GetParam()},
|
||||
.durability = {.storage_directory = storage_directory, .recover_on_startup = true}};
|
||||
memgraph::replication::ReplicationState repl_state{memgraph::storage::ReplicationStateRootPath(config)};
|
||||
memgraph::dbms::Database db{config, repl_state};
|
||||
VerifyDataset(db.storage(), DatasetType::BASE_WITH_EDGE_TYPE_INDEXED, GetParam());
|
||||
|
||||
// Try to use the storage.
|
||||
{
|
||||
auto acc = db.Access();
|
||||
auto vertex = acc->CreateVertex();
|
||||
auto edge = acc->CreateEdge(&vertex, &vertex, db.storage()->NameToEdgeType("et"));
|
||||
ASSERT_TRUE(edge.HasValue());
|
||||
ASSERT_FALSE(acc->Commit().HasError());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,8 @@ class IndexTest : public testing::Test {
|
||||
this->prop_val = acc->NameToProperty("val");
|
||||
this->label1 = acc->NameToLabel("label1");
|
||||
this->label2 = acc->NameToLabel("label2");
|
||||
this->edge_type_id1 = acc->NameToEdgeType("edge_type_1");
|
||||
this->edge_type_id2 = acc->NameToEdgeType("edge_type_2");
|
||||
vertex_id = 0;
|
||||
}
|
||||
|
||||
@@ -61,6 +63,8 @@ class IndexTest : public testing::Test {
|
||||
PropertyId prop_val;
|
||||
LabelId label1;
|
||||
LabelId label2;
|
||||
EdgeTypeId edge_type_id1;
|
||||
EdgeTypeId edge_type_id2;
|
||||
|
||||
VertexAccessor CreateVertex(Storage::Accessor *accessor) {
|
||||
VertexAccessor vertex = accessor->CreateVertex();
|
||||
@@ -68,11 +72,23 @@ class IndexTest : public testing::Test {
|
||||
return vertex;
|
||||
}
|
||||
|
||||
VertexAccessor CreateVertexWithoutProperties(Storage::Accessor *accessor) {
|
||||
VertexAccessor vertex = accessor->CreateVertex();
|
||||
return vertex;
|
||||
}
|
||||
|
||||
EdgeAccessor CreateEdge(VertexAccessor *from, VertexAccessor *to, EdgeTypeId edge_type, Storage::Accessor *accessor) {
|
||||
auto edge = accessor->CreateEdge(from, to, edge_type);
|
||||
MG_ASSERT(!edge.HasError());
|
||||
MG_ASSERT(!edge->SetProperty(this->prop_id, PropertyValue(vertex_id++)).HasError());
|
||||
return edge.GetValue();
|
||||
}
|
||||
|
||||
template <class TIterable>
|
||||
std::vector<int64_t> GetIds(TIterable iterable, View view = View::OLD) {
|
||||
std::vector<int64_t> ret;
|
||||
for (auto vertex : iterable) {
|
||||
ret.push_back(vertex.GetProperty(this->prop_id, view)->ValueInt());
|
||||
for (auto item : iterable) {
|
||||
ret.push_back(item.GetProperty(this->prop_id, view)->ValueInt());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -1292,3 +1308,368 @@ TYPED_TEST(IndexTest, LabelPropertyIndexClearOldDataFromDisk) {
|
||||
ASSERT_EQ(disk_test_utils::GetRealNumberOfEntriesInRocksDB(tx_db), 1);
|
||||
}
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TYPED_TEST(IndexTest, EdgeTypeIndexCreate) {
|
||||
if constexpr ((std::is_same_v<TypeParam, memgraph::storage::InMemoryStorage>)) {
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(acc->EdgeTypeIndexExists(this->edge_type_id1));
|
||||
EXPECT_EQ(acc->ListAllIndices().edge_type.size(), 0);
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 2 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
ASSERT_NO_ERROR(acc->Commit());
|
||||
}
|
||||
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
for (int i = 10; i < 20; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 2 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
|
||||
acc->AdvanceCommand();
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
|
||||
acc->Abort();
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
for (int i = 10; i < 20; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 2 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
|
||||
acc->AdvanceCommand();
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
|
||||
ASSERT_NO_ERROR(acc->Commit());
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
|
||||
acc->AdvanceCommand();
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 21, 23, 25, 27, 29));
|
||||
|
||||
ASSERT_NO_ERROR(acc->Commit());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TYPED_TEST(IndexTest, EdgeTypeIndexDrop) {
|
||||
if constexpr ((std::is_same_v<TypeParam, memgraph::storage::InMemoryStorage>)) {
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(acc->EdgeTypeIndexExists(this->edge_type_id1));
|
||||
EXPECT_EQ(acc->ListAllIndices().edge_type.size(), 0);
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 2 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
ASSERT_NO_ERROR(acc->Commit());
|
||||
}
|
||||
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
}
|
||||
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->DropIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(acc->EdgeTypeIndexExists(this->edge_type_id1));
|
||||
EXPECT_EQ(acc->ListAllIndices().label.size(), 0);
|
||||
}
|
||||
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_TRUE(unique_acc->DropIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(acc->EdgeTypeIndexExists(this->edge_type_id1));
|
||||
EXPECT_EQ(acc->ListAllIndices().label.size(), 0);
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
for (int i = 10; i < 20; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 2 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
ASSERT_NO_ERROR(acc->Commit());
|
||||
}
|
||||
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_TRUE(acc->EdgeTypeIndexExists(this->edge_type_id1));
|
||||
EXPECT_THAT(acc->ListAllIndices().edge_type, UnorderedElementsAre(this->edge_type_id1));
|
||||
}
|
||||
|
||||
{
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
|
||||
acc->AdvanceCommand();
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9, 11, 13, 15, 17, 19));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TYPED_TEST(IndexTest, EdgeTypeIndexBasic) {
|
||||
// The following steps are performed and index correctness is validated after
|
||||
// each step:
|
||||
// 1. Create 10 edges numbered from 0 to 9.
|
||||
// 2. Add EdgeType1 to odd numbered, and EdgeType2 to even numbered edges.
|
||||
// 3. Delete even numbered edges.
|
||||
if constexpr ((std::is_same_v<TypeParam, memgraph::storage::InMemoryStorage>)) {
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id2).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
EXPECT_THAT(acc->ListAllIndices().edge_type, UnorderedElementsAre(this->edge_type_id1, this->edge_type_id2));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD), IsEmpty());
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::OLD), View::OLD), IsEmpty());
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW), IsEmpty());
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::NEW), View::NEW), IsEmpty());
|
||||
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 2 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD), IsEmpty());
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::OLD), View::OLD), IsEmpty());
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(0, 2, 4, 6, 8));
|
||||
|
||||
acc->AdvanceCommand();
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(0, 2, 4, 6, 8));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(0, 2, 4, 6, 8));
|
||||
|
||||
for (auto vertex : acc->Vertices(View::OLD)) {
|
||||
auto edges = vertex.OutEdges(View::OLD)->edges;
|
||||
for (auto &edge : edges) {
|
||||
int64_t id = edge.GetProperty(this->prop_id, View::OLD)->ValueInt();
|
||||
if (id % 2 == 0) {
|
||||
ASSERT_NO_ERROR(acc->DetachDelete({}, {&edge}, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(0, 2, 4, 6, 8));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::NEW), View::NEW), IsEmpty());
|
||||
|
||||
acc->AdvanceCommand();
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::OLD), View::OLD),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::OLD), View::OLD), IsEmpty());
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(1, 3, 5, 7, 9));
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id2, View::NEW), View::NEW), IsEmpty());
|
||||
}
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TYPED_TEST(IndexTest, EdgeTypeIndexTransactionalIsolation) {
|
||||
if constexpr ((std::is_same_v<TypeParam, memgraph::storage::InMemoryStorage>)) {
|
||||
// Check that transactions only see entries they are supposed to see.
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id2).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
|
||||
auto acc_before = this->storage->Access(ReplicationRole::MAIN);
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
auto acc_after = this->storage->Access(ReplicationRole::MAIN);
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, this->edge_type_id1, acc.get());
|
||||
}
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(0, 1, 2, 3, 4));
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc_before->Edges(this->edge_type_id1, View::NEW), View::NEW), IsEmpty());
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc_after->Edges(this->edge_type_id1, View::NEW), View::NEW), IsEmpty());
|
||||
|
||||
ASSERT_NO_ERROR(acc->Commit());
|
||||
|
||||
auto acc_after_commit = this->storage->Access(ReplicationRole::MAIN);
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc_before->Edges(this->edge_type_id1, View::NEW), View::NEW), IsEmpty());
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc_after->Edges(this->edge_type_id1, View::NEW), View::NEW), IsEmpty());
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc_after_commit->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(0, 1, 2, 3, 4));
|
||||
}
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TYPED_TEST(IndexTest, EdgeTypeIndexCountEstimate) {
|
||||
if constexpr ((std::is_same_v<TypeParam, memgraph::storage::InMemoryStorage>)) {
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id2).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
this->CreateEdge(&vertex_from, &vertex_to, i % 3 ? this->edge_type_id1 : this->edge_type_id2, acc.get());
|
||||
}
|
||||
|
||||
EXPECT_EQ(acc->ApproximateEdgeCount(this->edge_type_id1), 13);
|
||||
EXPECT_EQ(acc->ApproximateEdgeCount(this->edge_type_id2), 7);
|
||||
}
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(hicpp-special-member-functions)
|
||||
TYPED_TEST(IndexTest, EdgeTypeIndexRepeatingEdgeTypesBetweenSameVertices) {
|
||||
if constexpr ((std::is_same_v<TypeParam, memgraph::storage::InMemoryStorage>)) {
|
||||
{
|
||||
auto unique_acc = this->storage->UniqueAccess(ReplicationRole::MAIN);
|
||||
EXPECT_FALSE(unique_acc->CreateIndex(this->edge_type_id1).HasError());
|
||||
ASSERT_NO_ERROR(unique_acc->Commit());
|
||||
}
|
||||
|
||||
auto acc = this->storage->Access(ReplicationRole::MAIN);
|
||||
auto vertex_from = this->CreateVertexWithoutProperties(acc.get());
|
||||
auto vertex_to = this->CreateVertexWithoutProperties(acc.get());
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
this->CreateEdge(&vertex_from, &vertex_to, this->edge_type_id1, acc.get());
|
||||
}
|
||||
|
||||
EXPECT_EQ(acc->ApproximateEdgeCount(this->edge_type_id1), 5);
|
||||
|
||||
EXPECT_THAT(this->GetIds(acc->Edges(this->edge_type_id1, View::NEW), View::NEW),
|
||||
UnorderedElementsAre(0, 1, 2, 3, 4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@ memgraph::storage::durability::WalDeltaData::Type StorageMetadataOperationToWalD
|
||||
return memgraph::storage::durability::WalDeltaData::Type::LABEL_INDEX_CREATE;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_DROP:
|
||||
return memgraph::storage::durability::WalDeltaData::Type::LABEL_INDEX_DROP;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EDGE_TYPE_INDEX_CREATE:
|
||||
return memgraph::storage::durability::WalDeltaData::Type::EDGE_INDEX_CREATE;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EDGE_TYPE_INDEX_DROP:
|
||||
return memgraph::storage::durability::WalDeltaData::Type::EDGE_INDEX_DROP;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_STATS_SET:
|
||||
return memgraph::storage::durability::WalDeltaData::Type::LABEL_INDEX_STATS_SET;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_STATS_CLEAR:
|
||||
@@ -280,6 +284,41 @@ class DeltaGenerator final {
|
||||
case memgraph::storage::durability::StorageMetadataOperation::UNIQUE_CONSTRAINT_DROP:
|
||||
data.operation_label_properties.label = label;
|
||||
data.operation_label_properties.properties = properties;
|
||||
break;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EDGE_TYPE_INDEX_CREATE:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EDGE_TYPE_INDEX_DROP:
|
||||
MG_ASSERT(false, "Invalid function call!");
|
||||
}
|
||||
data_.emplace_back(timestamp_, data);
|
||||
}
|
||||
}
|
||||
|
||||
void AppendEdgeTypeOperation(memgraph::storage::durability::StorageMetadataOperation operation,
|
||||
const std::string &edge_type) {
|
||||
auto edge_type_id = memgraph::storage::EdgeTypeId::FromUint(mapper_.NameToId(edge_type));
|
||||
wal_file_.AppendOperation(operation, edge_type_id, timestamp_);
|
||||
if (valid_) {
|
||||
UpdateStats(timestamp_, 1);
|
||||
memgraph::storage::durability::WalDeltaData data;
|
||||
data.type = StorageMetadataOperationToWalDeltaDataType(operation);
|
||||
switch (operation) {
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EDGE_TYPE_INDEX_CREATE:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EDGE_TYPE_INDEX_DROP:
|
||||
data.operation_edge_type.edge_type = edge_type;
|
||||
break;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_CREATE:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_DROP:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_STATS_CLEAR:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_STATS_CLEAR:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_INDEX_STATS_SET:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_CREATE:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_DROP:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EXISTENCE_CONSTRAINT_CREATE:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::EXISTENCE_CONSTRAINT_DROP:;
|
||||
case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_STATS_SET:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::UNIQUE_CONSTRAINT_CREATE:
|
||||
case memgraph::storage::durability::StorageMetadataOperation::UNIQUE_CONSTRAINT_DROP:
|
||||
MG_ASSERT(false, "Invalid function call!");
|
||||
}
|
||||
data_.emplace_back(timestamp_, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user