File tree Expand file tree Collapse file tree
src/main/java/picoded/dstack/mongodb Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,23 +88,22 @@ public void systemSetup() {
8888 //
8989 // We intentionally DO NOT use mongodb _id, allowing it retain optimal performance.
9090 //
91- // Overtime, when "maintainance" is called, additional
92- // indexes would be generated, to improve overall query peformance.
93- //
94- // This assumes "autoIndex" is enabled. The default behaviour is "true"
95- //
9691 IndexOptions opt = new IndexOptions ();
9792 opt = opt .unique (true );
9893 opt = opt .name ("_oid" );
94+ opt = opt .background (true );
9995 collection .createIndex (Indexes .ascending ("_oid" ), opt );
10096
10197 // Wildcard indexing
10298 //
10399 // This helps improve general performance for arbitary data
104100 // at a huge cost of write performance
105- opt = new IndexOptions ();
106- opt = opt .name ("wildcard" );
107- collection .createIndex (Indexes .ascending ("$**" ), opt );
101+ if (configMap .getBoolean ("setupWildcardIndex" , true )) {
102+ opt = new IndexOptions ();
103+ opt = opt .name ("wildcard" );
104+ opt = opt .background (true );
105+ collection .createIndex (Indexes .ascending ("$**" ), opt );
106+ }
108107 }
109108
110109 /**
You can’t perform that action at this time.
0 commit comments