Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mloginfo --queries should handle $geoWithin coordinates as a special case #692

Open
niccottrell opened this issue Jun 11, 2019 · 0 comments

Comments

@niccottrell
Copy link

Command: mloginfo --queries

Log file example:

2019-06-09T02:18:02.194+0000 I COMMAND  [conn3315845] warning: log line attempted (306kB) over max size (10kB), printing beginning and end ... command <db>.contact command: 
find { find: "contact", filter: { organizationId: 453003085614996, status: "A", $and: [ { $and: [ { topics: { $in: [ 1323816294855841 ] } } ] }, { address.gisLocation: { $geoWithin: { $geometry: { type: "MultiPolygon", coordinates: [ [ [ [ -65.62804, 21.71516825140505 ], [ -65.64420963581986, 21.71675551975397 ], [ -65.65967360817667, 21.72144805361499 ], [ -65.67375691757515, 21.72904104970793 ], [ -65.68584458261473, 21.73920307486481 ], [ -65.69540842654071, 21.75149047941973 ], [ -65.7020301412682, 21.76536670414984 ], [ -65.70541962446217, 21.78022565116438 ], [ -65.70542777901379, 21.79541811099792 ], [ -65.70205319493108, 21.81028010172561 ], [ -65.69544239313674, 21.82416188759842 ], [ -65.68588358901958, 21.83645640915617 ], [ -65.67379421922917, 21.8466258765832 ], [ -65.65970275527907, 21.8542253533769 ], [ -65.64422558856181, 21.8589222857949 ], [ -65.62804, 21.86051111000397 ], [ -65.61185441143819, 21.8589222857949 ], [ -65.59637724472093, 21.8542253533769 ], [ -65.58228578077085, 21.8466258765832 ], [ -65.57019641098042, 21.83645640915617 ], [ -65.56063760686325, 21.82416188759842 ], [ -65.55402680506891, 21.81028010172561 ], [ -65.55065222098621, 21.79541811099792 ], [ -65.55066037553783, 21.78022565116438 ], [ -65.55404985873182, 21.76536670414984 ], [ -65.56067157345929, 21.75149047941973 ], [ -65.56802740179188, 21.74203988201783 ], 
[ -65.56149000000001, 21.74268214455811 ], [ -65.54531764247383, 21.74109330242208 ], [ -65.52985312154027, 21.73639631640469 ], [ -65.51577315966119, 21.7287967509801 ], [ -65.50369364196857, 21.71862716125831 ], [ -65.49414260865812, 21.7063324862109 ], [ -65.48753715897936, 21.69245051961423 ], [ -65.48416527919696, 21.6775883266832 ], [ -65.48417337856718, 21.66239565083441 ], [ -65.48756005663942, 21.64753648343925 ], [ -65.49417634540406, 21.63366004477372 ], [ -65.50373238441918, 21.62137244422587 ], [ -65.51581020889689, 21.61121025232839 ], [ -65.52988207140572, 21.60361712890131 ], [ -65.54533348726439, 21.59892451517236 ], [ -65.56149000000001, 21.59733721960477 ], [ -65.57764651273563, 21.59892451517236 ], [ -65.59309792859428, 21.60361712890131 ], [ -65.60716979110312, 21.61121025232839 ], [ -65.61924761558083, 21.62137244422587 ], [ -65.62880365459596, 21.63366004477372 ], [ -65.6354199433606, 21.64753648343925 ], [ -65.63880662143282, 21.66239565083441 ], [ -65.63881472080305, 21.6775883266832 ], [ -65.63544284102065, 21.69245051961423 ], [ -65.6288373913419, 21.7063324862109 ], [ -65.62147257157341, 21.71581293328852 ], [ -65.62804, 21.71516825140505 ] ] ], [ [ [ -65.6024, 22.10273167662738 ], [ -65.6186134335603, 22.10431885470821 ], [ -65.62004559253332, 22.10475224356195 ], [ -65.62153758128638, 22.09822733423498 ], [ -65.62514885018054, 22.09067772598643 ], [ -65.6248530275688, 22.0893775701238 ], [ -65.6248613206796, 22.07418565326831 ], [ -65.62825788486728, 22.0593272600999 ], [ -65.63220445504469, 22.05107436333293 ], [ -65.62425143124746, 22.04439411079948 ], [ -65.61494573766555, 22.04157381370653 ], [ -65.60083582400631, 22.03397447873083 ], [ -65.58873065100481, 22.02380520696288 ], [ -65.57915938202321, 22.01151093093668 ], [ -65.57253999493616, 21.99762943411504 ], [ -65.56916107269979, 21.98276776674122 ], [ -65.56916931541096, 21.96757565229593 ], [ -65.57256329783422, 21.9527170575998 ], [ -65.5791937158351, 21.93884117484172 ], [ - .......... ], [ -111.3409870189675, 45.94200725624967 ], [ -111.3498351906326, 45.95582616199721 ], [ -111.3543741874997, 45.97062605497243 ], [ -111.3544023217616, 45.98576062258743 ], [ -111.3499147287822, 46.00056841579951 ], [ -111.3411042082147, 46.01440175600949 ], [ -111.3283533753153, 46.02665512867443 ], [ -111.3122183649097, 46.03679180793804 ], [ -111.2934047253826, 46.04436752095322 ], [ -111.2849332320142, 46.04628681117691 ], [ -111.2831904085338, 46.0490214931871 ], [ -111.270431632632, 46.06127480256369 ], [ -111.2542865541795, 46.07141143194637 ], [ -111.2394976630153, 46.0773627484483 ], [ -111.2235042164407, 46.08740125828369 ], [ -111.2046733891204, 46.094976918947 ], [ -111.1839862892357, 46.09965944838104 ], [ -111.16235, 46.1012434553111 ], [ -111.1407137107643, 46.09965944838104 ], [ -111.1200266108796, 46.094976918947 ], [ -111.1011957835593, 46.08740125828369 ], [ -111.0850460487118, 46.07726465193369 ], [ -111.0766659847413, 46.06921891810314 ], [ -111.0700330929983, 46.0650547669556 ], [ -111.0572734489529, 46.05280146448811 ], [ -111.0484568573094, 46.0389682078888 ], [ -111.0439661936736, 46.02416050929965 ], [ -111.0439943851252, 46.00902604386475 ], [ -111.0485365571397, 45.99422625615253 ], [ -111.0573908764159, 45.98040745345606 ], [ -111.0701679438906, 45.96817264872166 ], [ -111.08630822925, 45.95805536793063 ], [ -111.0981179798403, 45.95330669326886 ], [ -111.098144408052, 45.93906606403559 ], [ -111.1026808002016, 45.92426608454934 ], [ -111.1115239286794, 45.9104470941135 ], [ -111.1242848924373, 45.89821211617101 ], [ -111.1404048690521, 45.88809468719494 ], [ -111.1591797263882, 45.88053574421688 ], [ -111.17979072757, 45.87586456799345 ], [ -111.20134, 45.87428457797444 ] ] ], [ [ [ -114.03981, 50.88220779572298 ], [ -114.0635834547003, 50.88378601524631 ], [ -114.0863225450641, 50.88845200737469 ], [ -114.1070373138843, 50.89600272073135 ], [ -114.1248248139782, 50.9061094429651 ], [ -114.1389081584895, 50.91833194514653 ], [ -114.1486703832804, 50.93213746633624 ], [ -114.1536816582786, 50.94692375244199 ], [ -114.1537186174789, 50.96204518474059 ], [ -114.1487748703563, 50.97684088960365 ], [ -114.1390621068088, 50.99066361973664 ], [ -114.1250016045984, 51.00290814548787 ], [ -114.1072063781301, 51.01303789785639 ], [ -114.0864546501097, 51.02060866578841 ], [ -114.0636557582447, 51.02528826929424 ], [ -114.03981, 51.02687130344131 ], [ -114.0159642417553, 51.02528826929424 ], [ -113.9931653498903, 51.02060866578841 ], [ -113.97241362187, 51.01303789785639 ], [ -113.9546183954016, 51.00290814548787 ], [ -113.9405578931912, 50.99066361973664 ], [ -113.9308451296437, 50.97684088960365 ], [ -113.9259013825212, 50.96204518474059 ], [ -113.9259383417214, 50.94692375244199 ], [ -113.9309496167197, 50.93213746633624 ], [ -113.9407118415105, 50.91833194514653 ], [ -113.9547951860219, 50.9061094429651 ], [ -113.9725826861157, 50.89600272073135 ], [ -113.9932974549359, 50.88845200737469 ], [ -114.0160365452997, 50.88378601524631 ], [ -114.03981, 50.88220779572298 ] ] ] ] } } } } ] }, projection: { address: 1, _id: 1 } } planSummary: IXSCAN { organizationId: 1, topics: 1, status: 1, _id: 1 } keysExamined:1773 docsExamined:1773 cursorExhausted:1 numYields:14 nreturned:0 reslen:110 locks:{ Global: { acquireCount: { r: 30 } }, Database: { acquireCount: { r: 15 } }, Collection: { acquireCount: { r: 15 } } } protocol:op_query 100ms

Example output:

us_e01_contact.contact                 find         {"$and": [{"$and": [{"topics": 1}]}, {"address.gisLocation": {"$geoWithin": {"$geometry": {"coordinates": [[[[1], [1, 21.93884117484172], [1, 21.9527170575998], [1, 21.96757565229593], [1, 21.98276776674122], [1, 21.99762943411504], [1, 22.01151093093668], [1, 22.02380520696288], [1, 22.03397447873083], [1, 22.04157381370653], [1, 22.04439411079948], [1, 22.05107436333293], [1, 22.0593272600999], [1, 22.07418565326831], [1, 22.0893775701238], [1, 22.09067772598643], [1, 22.09822733423498], [1, 22.10273167662738], [1, 22.10431885470821], [1, 22.10475224356195], [1, 45.87428457797444], [1, 45.87586456799345], [1, 45.88053574421688], [1, 45.88809468719494], [1, 45.89821211617101], [1, 45.9104470941135], [1, 45.92426608454934], [1, 45.93906606403559], [1, 45.94200725624967], [1, 45.95330669326886], [1, 45.95582616199721], [1, 45.95805536793063], [1, 45.96817264872166], [1, 45.97062605497243], [1, 45.98040745345606], [1, 45.98576062258743], [1, 45.99422625615253], 
[1, 46.00056841579951], [1, 46.00902604386475], [1, 46.01440175600949], [1, 46.02416050929965], [1, 46.02665512867443], [1, 46.03679180793804], [1, 46.0389682078888], [1, 46.04436752095322], [1, 46.04628681117691], [1, 46.0490214931871], [1, 46.05280146448811], [1, 46.06127480256369], [1, 46.0650547669556], [1, 46.06921891810314], [1, 46.07141143194637], [1, 46.07726465193369], [1, 46.0773627484483], [1, 46.08740125828369], [1, 46.08740125828369], [1, 46.094976918947], [1, 46.094976918947], [1, 46.09965944838104], [1, 46.09965944838104], [1, 46.1012434553111]]], [[[1, 21.59733721960477], [1, 21.59892451517236], [1, 21.59892451517236], [1, 21.60361712890131], [1, 21.60361712890131], [1, 21.61121025232839], [1, 21.61121025232839], [1, 21.62137244422587], [1, 21.62137244422587], [1, 21.63366004477372], [1, 21.63366004477372], [1, 21.64753648343925], [1, 21.64753648343925], [1, 21.66239565083441], [1, 21.66239565083441], [1, 21.6775883266832], [1, 21.6775883266832], [1, 21.69245051961423], [1, 21.69245051961423], [1, 21.7063324862109], [1, 21.7063324862109], [1, 21.71516825140505], [1, 21.71516825140505], [1, 21.71581293328852], [1, 21.71675551975397], [1, 21.71862716125831], [1, 21.72144805361499], [1, 21.7287967509801], [1, 21.72904104970793], [1, 21.73639631640469], [1, 21.73920307486481], [1, 21.74109330242208], [1, 21.74203988201783], [1, 21.74268214455811], [1, 21.75149047941973], [1, 21.75149047941973], [1, 21.76536670414984], [1, 21.76536670414984], [1, 21.78022565116438], [1, 21.78022565116438], [1, 21.79541811099792], [1, 21.79541811099792], [1, 21.81028010172561], [1, 21.81028010172561], [1, 21.82416188759842], 
[1, 21.82416188759842], [1, 21.83645640915617], [1, 21.83645640915617], [1, 21.8466258765832], [1, 21.8466258765832], [1, 21.8542253533769], [1, 21.8542253533769], [1, 21.8589222857949], [1, 21.8589222857949], [1, 21.86051111000397]]], [[[1, 50.88220779572298], [1, 50.88220779572298], [1, 50.88378601524631], [1, 50.88378601524631], [1, 50.88845200737469], [1, 50.88845200737469], [1, 50.89600272073135], [1, 50.89600272073135], [1, 50.9061094429651], [1, 50.9061094429651], [1, 50.91833194514653], [1, 50.91833194514653], [1, 50.93213746633624], [1, 50.93213746633624], [1, 50.94692375244199], [1, 50.94692375244199], [1, 50.96204518474059], [1, 50.96204518474059], [1, 50.97684088960365], [1, 50.97684088960365], [1, 50.99066361973664], [1, 50.99066361973664], [1, 51.00290814548787], [1, 51.00290814548787], [1, 51.01303789785639], [1, 51.01303789785639], [1, 51.02060866578841], [1, 51.02060866578841], [1, 51.02528826929424], [1, 51.02528826929424], [1, 51.02687130344131]]]], "type": 1}}}}], "organizationId": 1, "status": 1}                    1         100         100                 100.0                 100.0    100

The value of "$geoWithin.$geometry.coordinates" should probably always be compacted down to 1 to make it possible to see query shapes at a higher level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants