I’m trying to wrap my head around indexing in mongoldb in my meteor app.
Question 1: When exactly is the index performed? Specifically, if I have a simple form that asks for input from the user and upon a button click the query spits out a report of some kind, is the collection first indexed upon the button click, and then the query runs right after the index has finished?
Question 2: How expensive is the build of the index? Put another way, could it be possible that the building of the index could be more expensive than no index at all with just the query scanning the whole data set?
Question 3: Should all my mongo queries be indexed?
My collections are relatively small; somewhere in the order of about 5,000 documents each. But some of my queries are computationally intensive and require a pre loader for support for the user.
Many thanks to all of guys and gals who I’ve learned from.