indexing - Checking position of an entry in an index MongoDB -
i have query using pymongo outputting values based on following: cursor = db.collect.find({"index_field":{"$regex":'\s'}} document in cursor: print document["_id"] now query has been running long time (over 500 million documents) expected. wondering though if there way check query in execution perhaps finding out last printed "_id" in indexed field. last printed _id halfway through btree index? near end? i want know see if should cancel query , reoptimize and/or let finish, have no way of knowing _id exists in query. also, if has way optimize whitespace query, helpful to. based on doc, seems if of used ignorecase of been faster, although doesn't make sense whitespace checking. thanks much, j query optimization your query cannot optimized, because it's inefficient $regex search that's looking space \s in the document. can do, search $regex prefix of \s , e.g. db.collect.find({"index_field&q