kalisio / k-vigicrues

A Krawler based service to download data from French flood warning system Vigicrues
MIT License
3 stars 0 forks source link

reduce vigicrues-observations IO utilization #11

Closed cnouguier closed 5 years ago

cnouguier commented 5 years ago

From MongoAtlas support:

We also see the following query that could potentially reduce IO utilization.

2019-06-01T07:56:31.665+0000 I COMMAND [conn120827] command kargo.vigicrues-observations command: find { find: "vigicrues-observations", filter: { properties.CdStationHydro: "K091003010", properties.Q: { $exists: true } }, sort: { time: -1 }, limit: 1, returnKey: false, showRecordId: false, $clusterTime: { clusterTime: Timestamp(1559375790, 18), signature: { hash: BinData(0, 8229800B91AAE41C5580E307EA35A947EA8ED024), keyId: 6666685517167329282 } }, $db: "kargo" } planSummary: IXSCAN { properties.CdStationHydro: 1, time: -1 } keysExamined:2010 docsExamined:2010 cursorExhausted:1 numYields:20 nreturned:0 reslen:241 locks:{ Global: { acquireCount: { r: 42 } }, Database: { acquireCount: { r: 21 } }, Collection: { acquireCount: { r: 21 } } } protocol:op_query 280ms 

Please consider adding an index on {"properties.CdStationHydro": 1, "properties.Q": 1, time: -1}  
cnouguier commented 5 years ago

Since we have implemented the trick, it seems to be ok