-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.0.8, 3.2.1
-
Query Execution
-
ALL
-
Query 15 (06/03/16), QE 2022-10-17, QE 2022-10-31, QE 2022-11-14, QE 2022-11-28, QE 2022-12-12, QE 2022-12-26, QE 2023-01-09
With following index:
db.c.createIndex({p: "2dsphere", s: 1})
and 10M of the following documents:
x = '' for (i=0; i<1000; i++) x += 'x' doc = {p: [0,0], s: 0, x: x}
run following query, which finds 0 documents:
db.c.find({
p: {
$near: {
$geometry: {
coordinates: [1, 0],
type: "Point"
},
},
},
s: {$ne: 0}
}).itcount()
}
Result as follows:
- peak memory usage is about 13 GB in excess of WT cache
- query has scanned 20M documents to return 0, in spite of index. Changing query to e.g. s: 1 instead of s: {$ne: 0} eliminates document scan and excess memory usage.
- less highly skewed point distribution reduces problem presumably because skewed distribution requires accumulating all documents in memory for sort
- is duplicated by
-
SERVER-32180 mongod oom with low connections
- Closed
- is related to
-
SERVER-20239 Built-in sampling heap profiler
- Closed
- related to
-
SERVER-82167 $regex may use unbounded cpu and memory
- Investigating
-
SERVER-20239 Built-in sampling heap profiler
- Closed