Configuration of remote server: Ubuntu 20.04 on Digital ocean (1vcpu, 1GM Ram, 25GB memory) MongoDb running on Digital ocean machine
Local machine: MacOS, Dockerized Nodejs express server (from here I am searching through my collections)
I created 2 collections in my DB, one is indexed (PartnerModelIndex) and another not (PartnerModel).
- See picture:
I created 2 API routes on my NodeJS - only one of them searches through indexed collection:
I also filled my collections with 1.000.000 (million) documents with following parameters:
- title - has approximately 20-30 words (each document)
- description - has approximately 5k - 6k characters (each document)
Here is my MongoDB compass showing the occupied memory by indexes:
The problem is that when I try to search for any non-existent string in my database (through title and description) I get the same execution time for both indexed and non-indexed collection, see image
And non-indexed:
What could be the reason for this strange behavior? Thank you in advance!