Home > database >  Mongo create indexes, existing a lot of data, the data word will join index?
Mongo create indexes, existing a lot of data, the data word will join index?

Time:10-11

Found in directing a project performance is poor, then create an index,
Before I don't know what the reason, no single create collection, is the automatically created when getcollection,
So, now is the place where the inserts I create this index,
This is the problem with,
I insert the 1000 records, and create 1000 index, the test found that doesn't have any query performance optimization,

So I indexes specified in the initialization phase, just create an index, and then insert records, found that optimization of obvious,

Problem again,
If my version, my record is not indexed before, after the upgrade, specify the index again, also has no optimization effect?

Under the condition of the database already exists, how to do, would it be possible for me to create the index of the effect?

CodePudding user response:

Have been effective index once created, even if the first without the data, the index is effective,

When halfway through adding indexes, existing data could also be indexed before,
  • Related