2e數據量下MongoDB查詢性能測試

硬件環境:三臺4核CPU、32G內存、100G磁盤
測試數據量: 1.96e

Order表結構如下:

{	
	"_id": ObjectId,
	"uid": "uid186642", //有索引
	"name": "商品214",
	"money": 899
}

語句類型 查詢語句 有無索引 測試結果(時間,返回數據量)
等值查詢 db.order.find({uid:“uid150902”}) 7ms, 949條
等值查詢 db.order.find({money:999}) 28.57s, 1929條
In查詢 db.order.find({uid: {$in: [“uid100000”, “uid123456”, “uid089345”]}}) 19ms, 2860條
In查詢 db.order.find({money: {$in: [300, 450, 999]}}) 30.37s, 5871條
範圍查詢 db.order.find({uid:{$gt:“uid198800”}}) 4.59s,117w條
範圍查詢 db.order.find({money:{$gt:990}}) 29.00s, 196.9w條
聚合操作 查看某個uid下花錢的總數 N/A 354.91s, 20w條
全表掃描 db.order.find({}) N/A 75.174s, 1.96e條
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章