项目中使用mongo数据库的错误

Caused by: com.mongodb.MongoQueryException: Query failed with error code 17144 and error message 'Runner error: Overflow sort stage buffered data usage of 33554586 bytes exceeds internal limit

1.查看查询条件使用什么字段查询的 如query.order("number")

2.查看数据库有没有为该字段建立索引 db.<collection>.getIndexes()

3. 如果没有建立索引db.ensureIndex({number:-1(或1)})

MongoDB索引使用B-tree数据结构。

 建立索引的目的,提高查询效率会在query之前数据库按索引range。

 弊端:索引过多会使得插入效率过低(因为每次插入(索引都会重新构造B-tree)

 

 

 mongoimport -h 192.168.1.10 -d xinmeiti -c weiboAnalyse --directoryperdb weiboAnalyse.json --drop

exception:BSON representation of supplied JSON is too large: code FailedToParse: FailedToParse: Trailing number at end of input: offset:1547 of:{ "_id" : { "$oid" : "57d0c3e6fa9ae90dc6839aec" }, "updateTime" : 1514567702552, "rank_append" : { "17-10-19-01" : { "rank" : 39494, "factor" : 0.0731883945878533 }, "17-11-04-01" : { "rank" : 39533, "factor" : 0.0731883945878533 }, "17-11-15-01" : { "rank" : 40115, "factor" : 0.07329512825652773 }, "17-10-11-01" : { "rank" : 39226, "factor" : 0.0731883945878533 }, "17-12-14-01" : { "rank" : 40795, "factor" : 0.07360409811643538 }, "17-10-21-01" : { "rank" : 39494, "factor" : 0.073188
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值