PMXBOT Log file Viewer

Help | Karma | Search:

#mongodb logs for Saturday the 29th of September, 2012

(Back to #mongodb overview) (Back to channel listing) (Animate logs)
[05:31:28] <hadees> is there a performance difference between $in with only searching for one thing and just a regular query?
[05:31:59] <mrpro> i'd think so unless its smart enough to change in with one element for regular
[06:06:28] <mmlac> If I have a collection that heavily gets queried using two fields in conjunction, a: "xxx", b: "yyy", what would be a good index for that? just ensureIndex({a: 1, b: 1})?
[06:09:09] <crudson> looks fine to me
[06:10:23] <mmlac> ok thanks
[06:11:19] <crudson> you can always do .explain() or run server with --notablescan to be strict about indexes
[06:57:33] <daurnimator> how do you get around the fact that bson dictionaries are ordered?
[07:08:03] <daurnimator> http://www.mongodb.org/display/DOCS/Inserting If you're seeing this, it means something is horribly wrong with the MongoDB confluence site.
[07:55:15] <alexluya> Hello,I want to compile hadoop connector,get this error:Hadoop Release '%s' is an invalid/unsupported release. Valid entries are in 1.0.3
[08:36:47] <chovy> is there a url type?
[08:36:53] <chovy> i am storing a link
[08:36:57] <chovy> as an attribute
[08:45:41] <kali> no url type, just use String
[08:50:40] <chovy> ok
[09:19:10] <monu> Hi, i'm a new mongodb user. And for some understanding, i create several db ( admin, check, test for example) and i want to add automatically admin user to all the db. There is a method ??
[09:23:36] <monu> Should i add manually on each db, admin user ?
[09:27:52] <monu> How can i add automatically admin user to new db ?
[12:02:23] <Aartsie> How to secure a mongoDB ? i followed this steps http://www.mongodb.org/display/DOCS/Security+and+Authentication but it don't work
[12:17:25] <Bilge> xD
[12:23:10] <kali> Aartsie: if you want to get some help, you need to say more.
[12:30:08] <Aartsie> kali: What i have done is create the admin user and regular user
[12:30:36] <Aartsie> when i want to start the mongo --auth it gives an error
[12:32:03] <kali> what error, ffs
[12:34:50] <Aartsie> kali: ERROR: unknown option auth
[12:36:44] <kali> Aartsie: well, --auth is an option for mongod, not mongo
[12:37:26] <Aartsie> aha so i must run it as deamon ?
[12:37:39] <Aartsie> i'm a linux beginner
[12:38:39] <kali> mongod is the daemon, mongo the command line client
[12:38:52] <kali> i suggest you start without authentication
[12:39:10] <kali> on step at a time
[12:39:14] <kali> +e
[12:59:45] <barcelona0202> is this the place also for pymongo?
[13:04:31] <NodeX> best to just ask
[13:04:33] <Aartsie> kali: yes i start now without authentication
[13:16:59] <barcelona0202> is there a way to get the lastest entries to a mongoDB "streamed" out, so that instead of having to query the db every x seconds to check for new entries, i can be notified as new entries appear? (pymongo, python) thanks
[13:17:17] <barcelona0202> "notified" in a class or function, that is.
[13:24:28] <NodeX> there is no pub/sub in mongo if that's what you're after
[13:28:25] <barcelona0202> NodeX: I suppose some kind of subscriptions, yes. so what would be the most efficient way of handling every entry to the db as they arrive (100/second) ?
[13:43:04] <NodeX> there are some rivers for Elastic search that monitor the oplog
[13:43:07] <NodeX> perhaps that can help
[14:07:48] <barcelona0202> NodeX: thanks, looks promising!
[14:11:28] <wereHamster> barcelona0202: tailable cursors?
[14:29:36] <barcelona0202> wereHamster: thanks.
[17:42:54] <peas> how many spatial lookups does mongodb support? https://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/#compatibility-tables
[17:56:55] <wereHamster> peas: what quantity is '1 spacial lookup' ?
[17:59:39] <peas> wereHamster: 1=1 ;-> : in reference to the compatibility tables, are you saying mongodb geospatial indexing supports only one "Lookup Type"?
[18:35:23] <Goopyo> When is it better to create a collection vs index a category?
[18:36:51] <Goopyo> i.e posts_wall posts_chat posts_comments vs posts with a category field of ['wall' , 'chat', 'comments'] ?
[18:38:16] <kali> Goopyo: choose the layout that will make your most frequent queries faster
[18:38:38] <kali> Goopyo: if you show wall chat and comments interspeded, put them in the same collection
[18:39:02] <Goopyo> ok so if you are querying across things keep them in one?
[18:39:10] <Goopyo> across categories*
[18:39:41] <Goopyo> but then that would make you more susceptible to needing sharding down the road right?
[18:40:00] <kali> maybe yes. the point being, when you design for mongodb, you need to thiknk about how you access the data
[18:41:19] <kali> Goopyo: that's right, you will have a bigger collection. but a sharded collection (by user_id and timestamp for instance ?) might be more efficient than hitting three collections on three different servers
[18:42:16] <Goopyo> yeah. You already addressed that, thats exactly what I plan on doing (I will query across categories) so it makes sense to keep it in one collection. However I'm curious as which has more overhead 3 queries on small collection or one on a big one.
[18:44:01] <kali> Goopyo: if the index are in memory, I guess it will be more or less equivalent
[18:44:46] <kali> a good option for this use case is to paginate the items together
[18:45:04] <kali> there was a blog post somewhere...
[18:46:22] <Goopyo> so if they're equivalent the 1 collection use case is probably easier. How about for scaling would they be the same?
[18:47:24] <kali> Goopyo: the important thing is to paginate items, actualy
[18:47:34] <kali> Goopyo: store 10 or 20 of them in the same document
[18:47:45] <Goopyo> whoaaaa
[18:47:59] <Goopyo> mind blown. Do you have that blog article? googling now
[18:48:10] <kali> looking for it
[18:48:23] <Goopyo> google pagination always brings up orm/web framework stuff
[18:48:24] <kali> but this is more important than one or three collection :)
[18:49:10] <kali> basic idea was: one doc per item is easy but inneficient. one doc per user is just as easy and bad
[18:49:33] <kali> the right thing to do require more work, but allow for a much better data locality
[18:49:50] <Goopyo> very true. Now that I think about it collections should be separated only when the data structures of the documents are different. Its more of a organization thing
[18:50:24] <Goopyo> oh and is this all handled software side?
[18:50:52] <Goopyo> I guess you could put them in say 5 minute packets
[18:51:05] <sambomartin> hi, i have a question about an using $and with a couple of indexed attribs. is this a good place to ask?
[18:51:25] <Goopyo> yup just ask. someone will help
[18:51:47] <kali> Goopyo: yeah, it's application side logic. it depends too much on your use case for mongodb to have a generic solution i guess
[18:52:17] <sambomartin> { "kw" : { "$all" : [/^one/, /^two/, /^three/] }
[18:52:29] <kali> Goopyo: sorry, i can't find that blog post, but I think I gave you the idea :)
[18:52:30] <adkron> I'm having some trouble with ruby mongo 1.7.0 it looks like when a collection doesn't exist and I'm using a replica set I get (errmsg: 'not master'; ok: '0.0')
[18:52:32] <sambomartin> when explained, uses index
[18:52:40] <Goopyo> kali: to be honest I'm suprised it makes much a performance difference, considering if the documents are store efficiently the only true difference should be the extra _id field
[18:53:00] <kali> Goopyo: it's all about locality
[18:53:18] <Goopyo> adkron: did you enable use secondary?
[18:53:19] <kali> Goopyo: if you group items in the same documents, they'll be store together on the memory and on the disk
[18:53:33] <sambomartin> if i {$and: [ { "kw" : { "$all" : [/^princes/, /^street/, /^suffolk/] }}, { "kw" : { "$all" : [/^princes/, /^street/, /^suffolk/] }}]}
[18:53:45] <Goopyo> kali: ohhhh that makes sense
[18:53:49] <kali> Goopyo: so if you want 100 docs and group them by 10, you only need to make 10 accesses
[18:53:50] <sambomartin> bad example, but you get the idea, it doesn't use index
[18:53:55] <sambomartin> only basiccursor
[18:54:05] <adkron> Goopyo: Yes, but why would it write to taht
[18:54:22] <adkron> I'm doing this from Ruby. mongo 1.7.0 mongoid 2.5.0
[18:54:30] <Goopyo> kali: oh that makes perfect sense then
[18:54:50] <Goopyo> kali: but you'd have to come up with a great design to use the marginal benefits well
[18:55:07] <sambomartin> so looks like using $and stops using index, and reverts to basiccursor (scanning every object)
[18:55:14] <Goopyo> adkron: are you doing a read or a write?
[18:55:24] <kali> now, you'll excuse me, toulon is playing toulouse.
[18:55:28] <adkron> Goopyo a write
[18:55:56] <Goopyo> and which db is your client connecting to?
[18:56:07] <adkron> Goopyo: It only fails when the collection doesn't already exist. If I write from a console it writes just fine. After that I can write fine.
[18:57:27] <Goopyo> oh so you want to make the collection on the fly on the secondary?
[18:57:41] <adkron> Goopyo: Does this help? <Mongo::ReplSetConnection:0x5ab2df4 @seeds=[["tm29-s00010", 27017], ["tm29-s00011", 27017], ["tm29-s00012", 27017]] @connected=true>
[18:57:55] <adkron> 10 is the primary
[18:58:24] <adkron> The error message doesn't tell me which one it is trying to write to when it fails
[18:58:58] <Goopyo> have you tried the create collection command?
[18:59:09] <sambomartin> does anyone know why the $and operator would be causing mongo not to use index?
[18:59:55] <adkron> Goopyo: No because when I try to write it just works from the rails console. Doesn't work at all from the web app. I can try the create command from the console.
[19:00:36] <adkron> Goopyo: Should it not create the collection when you try to write? I've been working with Mongo for 2 and a half years and have never had an issue like this.
[19:01:03] <adkron> I've been fighting this for two days. Maybe I should have used the support contract we have.
[19:01:21] <Goopyo> sambomartin: if I recall with an $and query all the keys have to be indexed for it to use an index. Do you have a multipart index set?
[19:02:03] <Goopyo> adkron: yeah writing to a new collection should create it.
[19:34:30] <kali> adkron: are you sure the RS is fine ?
[19:36:59] <adkron> kali: It says everything is fine when I get into the mongo console.
[19:37:20] <kali> it does have a primary ?
[19:37:21] <adkron> kali: It is ony an issue from the rails app. I'm downgrading gems to see if that was an issue.
[19:37:27] <adkron> kali: Yeah
[19:37:51] <adkron> kali: The mongo ruby driver doesn't tell me where tried to write in the error message. That is frustrating.
[19:38:08] <kali> you rails server can resolve the three hostnames ?
[19:38:51] <adkron> kali: lmc
[19:38:59] <kali> are you on ec2 ?
[19:39:45] <adkron> kali: It works. No I'm on a private cloud at Engine Yard.
[19:40:30] <kali> ok, i don't know how EY works, but sometimes pepole have problem mixing internal and external hostnames
[19:41:26] <kali> i use mongo driver 1.7.0 and mongoid 2.4.10, but not talking to RS (using mongos on localhost)... i can't seen anything else to check
[19:41:29] <adkron> All of my hostnames look like tm##-s000##. They are also all in my hosts file poiting to ips.
[19:41:38] <kali> try mongosniff...
[19:42:19] <adkron> kali: Thanks. Now If I can just get EY to get on the line with me. I also have a mongo support contract, but I think I'm on my own when using mongoid.
[19:42:47] <kali> adkron: it does not look like a mongoid issue
[19:44:13] <adkron> I just downgraded the mongo and mongoid gems. I redeployed and it seems to be working.
[19:46:18] <adkron> kali and Goopyo thanks for trying to help
[19:49:54] <adkron> kali, I downgraded mongoid 2.5.0 -> 2.4.12 and mongo 1.7.0 -> 1.6.2
[19:54:22] <Goopyo> kali: would you happen to know if a single $in has a better or worse performance than a match?
[20:54:08] <timeturner> is it possible based on multiple matches?
[20:54:30] <timeturner> like db.users.find({_id: something || somethingElse || somethingElse2})
[20:55:16] <timeturner> to query*
[20:58:12] <wereHamster> yes, it's called 'or'
[20:58:21] <wereHamster> google it
[20:58:31] <timeturner> i did
[20:58:41] <timeturner> but it says that $or is for after you've found the docs
[20:58:46] <timeturner> as an addition
[20:59:04] <timeturner> for the fields of a doc
[20:59:07] <mrpro> no
[20:59:16] <timeturner> I'm querying for docs based on an or
[20:59:19] <wereHamster> timeturner: really? Where exactly did you read that?
[20:59:39] <timeturner> wait
[21:00:46] <timeturner> db.users.find($or:[{_id:something}, {_id:somethingElse}, {_id:somethingElse2}]) will work>
[21:00:47] <timeturner> ?
[21:00:57] <trepidaciousMBR> Anyone know how to get the id of an object I've just inserted using Casbah?
[21:01:02] <trepidaciousMBR> Or the java driver
[21:02:02] <wereHamster> timeturner: try it and see
[21:04:15] <timeturner> yeah it works...
[21:13:33] <sambomartin> following on from $and problem, i've nailed it down to sparse indexes
[21:15:30] <sambomartin> col.find({ $and : [{'att':'this'}, {'att','that'}]}) // no i obviously know this doesn't make sense but i wanted to see if the index is used
[21:15:49] <sambomartin> is att is a sparse index, it wont be used for $and
[21:17:34] <timeturner> are mongodb queries reordered for best performance?
[21:55:37] <gigo19801> hi all does anyone use an thirdparty map reduce for mongo db, so that you dont fall in the javascript single thread ?
[23:15:38] <Almindor> how do you specify date to mongodump? I tried mongodump -d dbname -c colname -q '{dtime:{$gt:{$date:1343800800000}}}' which should be 1st aug 2012 (and works as a find inside the db itself) but it gives me 0 results
[23:17:15] <Almindor> oh you need the " there
[23:17:44] <Almindor> hmm wait no if I quote the keys it gives me all documents...