Skip to content

Wrong index suggestion when using BinData fields #37

@isartmontane

Description

@isartmontane

We are running dex on our production dataset but we are not getting the right indexes when a BinData field is used.

For example, for the following log line:

2016-03-14T15:33:49.177+0000 I WRITE    [conn826040] update collection query: { _id: BinData(0, 6165363837656337373438316233343862333033363464663961336231353262) } update: { $set: { a: 1 } } nscanned:1 nscannedObjects:1 nMatched:1 nModified:0 keyUpdates:0 writeConflicts:0 numYields:1 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { w: 2 } }, Collection: { acquireCount: { w: 2 } } } 1440ms

We get the following suggestion:

        {
            'queryMask': '{"$query":{"6165363837656337373438316233343862333033363464663961336231353262)":"<val>","_id":"<val>"}}', 
            'namespace': 'db.collection', 
            'recommendation': {
                'index': '{"_id": 1, "6165363837656337373438316233343862333033363464663961336231353262)": 1}', 
                'namespace': 'db.collection', 
                'shellCommand': 'db["collection"].ensureIndex({"_id": 1, "6165363837656337373438316233343862333033363464663961336231353262)": 1}, {"background": true})'
            }, 
            'details': {
                'count': 1, 
                'totalTimeMillis': 1440, 
                'avgTimeMillis': 1440
            }
        }, 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions