PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 17th of September, 2016

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[00:01:13] <Guest24> query is so long explain even dies
[00:01:30] <Guest24> it's just sort that kills it
[00:01:43] <Guest24> but they have to be ordered
[00:01:46] <Guest24> :(
[00:01:59] <StephenLynx> if that`s actually indexed
[00:02:02] <StephenLynx> then it shouldn`t be a problem.
[00:02:11] <StephenLynx> are you SURE there`s an index there?
[00:03:15] <Guest24> https://gist.github.com/jamieshepherd/d8e845a1c41f71a58e840dad816bfa8d
[00:03:25] <Guest24> seems like it's only using one of the 3 indexes though
[00:05:14] <Guest24> that's without the sort("endedAt": 1)
[00:07:21] <Guest24> Here's my indexes.. https://gist.github.com/jamieshepherd/34197514d7aa1c43e72804576ebd582f
[00:08:46] <Guest24> i'm pretty lost at this point, maybe this type of query just shouldn't be done in mongo
[00:09:10] <StephenLynx> try the same query on the shell.
[00:09:18] <Guest24> I have, same problm
[00:09:24] <Guest24> it's not the mgo library, it was the sort()
[00:09:44] <Guest24> the 2nd to last gist was the query on the shell without sort()
[00:10:02] <Guest24> but sort() just locks the entire thing up
[00:11:09] <StephenLynx> did try the explain with the sort?
[00:11:15] <Guest24> yeah, times out
[00:11:42] <StephenLynx> show the query used
[00:11:58] <Guest24> db.matches.explain("executionStats").find({isLive: false, eloComplete: { $exists: false } }).sort({endedAt: 1}).limit(10)
[00:12:52] <StephenLynx> try removing that compound index at the end
[00:12:57] <StephenLynx> and removing the explain.
[00:13:08] <StephenLynx> "name" : "idx_eloComplete_isLive_endedAt",
[00:13:17] <Guest24> oh I just added that after it was already slow
[00:13:23] <Guest24> it doesn't even get called I'm pretty sure
[00:13:36] <Guest24> query without explain times out
[00:13:47] <Guest24> there's 1.5 million records in total so it's a pretty big query
[00:13:58] <StephenLynx> yeah, but if its indexed, it shouldn`t be an issue.
[00:14:08] <StephenLynx> I am 95% sure there`s some mistake on your side.
[00:14:16] <Guest24> yeah, I hope so, I just can't see what it is
[00:14:30] <StephenLynx> are you on the same db when you check those indexes?
[00:14:36] <StephenLynx> are they on the right collection?
[00:14:41] <StephenLynx> what`s your mongodb version?
[00:16:25] <Guest24> could it be they are all "background" indexes?
[00:16:40] <StephenLynx> how did you create those indexes?
[00:16:43] <Guest24> I couldn't actually delete the last index
[00:16:44] <Guest24> "errmsg" : "cannot perform operation: a background operation is currently running for collection paragon.matches",
[00:16:47] <StephenLynx> I don`t even know that setting.
[08:13:41] <mpajor> I am really trying to get started with python/Flask and mongodb.
[08:14:11] <mpajor> I am however having major issues doing a simple task, returnin a json response of db.<collection>.find({}) in python. It returns an object and not json as wanted.
[08:14:41] <mpajor> I've looked at jsonify() but I cannot get anything to work because the _id object seems to cause issues.
[08:18:07] <mpajor> figured it out, had to create a function to convert mongodb objects to json using: return json.dumps(data, default=json_util.default)