Optimized create_schema.gsql
@@ -43,3 +43,13 @@ CREATE DIRECTED EDGE LIKES (FROM Person, TO Comment|Post, creationDate DATETIME)
CREATE DIRECTED EDGE REPLY_OF (FROM Comment, TO Comment|Post, creationDate DATETIME) WITH REVERSE_EDGE="REPLY_OF_REVERSE"
CREATE DIRECTED EDGE STUDY_AT (FROM Person, TO University, classYear INT, creationDate DATETIME) WITH REVERSE_EDGE="STUDY_AT_REVERSE"
CREATE DIRECTED EDGE WORK_AT (FROM Person, TO Company, workFrom INT, creationDate DATETIME) WITH REVERSE_EDGE="WORK_AT_REVERSE"
+
+CREATE GLOBAL SCHEMA_CHANGE JOB addIndex {
+ ALTER VERTEX Country ADD INDEX country_name ON (name);
+ ALTER VERTEX Company ADD INDEX company_name ON (name);
+ ALTER VERTEX University ADD INDEX university_name ON (name);
+ ALTER VERTEX Tag ADD INDEX tag_name ON (name);
+ ALTER VERTEX TagClass ADD INDEX tagclass_name ON (name);
+}
+
+RUN GLOBAL SCHEMA_CHANGE JOB addIndex
\ No newline at end of file
