При запросе документов mongo кидает QueryFailure flag was too much data for sort() with no index

79 views
Skip to first unread message

Руслан Бикмулин

unread,
Oct 30, 2013, 3:49:07 AM10/30/13
to mongodb-us...@googlegroups.com
Доброе время суток!)

Прошу совета в такой вот ситуации...

Есть таблица с документами которая прежде была без индексов и имела небольшое количество записей. На данный момент таблица занимает 4 гб и имеет 4,5 млн записей.
При попытке получить документы ловлю ошибку :
QueryFailure flag was too much data for sort() with no index. add an index or specify a smaller limit (response was { "$err" : "too much data for sort() with no index. add an index or specify a smaller limit", "code" : 10128 })

Пробовал вставить индекс.... не решилась проблема

Структура записи
такова

{
  "_id" : ObjectId("000000000000000000000000"),
  "Recepient" : {
    "Email" : "",
    "OperatorId" : ObjectId("000000000000000000000000")
  },
  "CreeateDate" : ISODate("дата"),
  "SendDate" : null,
  "Subject" : "тема",
  "Message" : "сообщение'",
  "NotificationRule" : {
    "MastSendToEmail" : false,
    "Name" : "имя",
    "Order" : 140
  },
  "DocumentRef" : {
    "_id" : ObjectId("000000000000000000000000"),
    "Identifier" : "что то"
  }
}

поиск идет по id

Заранее спасибо)

Денис Захаров

unread,
Oct 30, 2013, 3:51:41 AM10/30/13
to mongodb-us...@googlegroups.com
Покажи запрос, индексы


30 октября 2013 г., 11:49 пользователь Руслан Бикмулин <dev.r...@gmail.com> написал:

--
You received this message because you are subscribed to the Google Groups "MongoDB по-русски" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user-rus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Serge Matveenko

unread,
Oct 31, 2013, 1:58:56 AM10/31/13
to mongodb-us...@googlegroups.com
ну, да, тут как в sql практически

пишем: db.someCollectionName.find({some: query}).sort({field:
direction}).explain()

и внимательно читаем чего написало.

про то что оно там пишет читают здесь
http://docs.mongodb.org/manual/reference/method/cursor.explain/



2013/10/30 Денис Захаров <denis.z...@gmail.com>:
--
Serge Matveenko
mailto: se...@matveenko.ru
github: http://lnkfy.com/1
linkedin: http://lnkfy.com/S
Reply all
Reply to author
Forward
0 new messages