[06:23:39] <sellout> With prepared statements, the DB also knows that you’re making the same request with a changed parameter, so the execution plan stays cached and gets rerun. If you just send a new string, the DB can’t tell that it’s the same request with a different parameter.
[06:23:42] <stefandxm> he shows you how to do prety much everything with that code
[06:24:02] <stefandxm> sellout, i wish that was true :)
[06:24:16] <stefandxm> sellout, ive seen many databases handling pure sql better than prepared statements :(
[06:25:17] <stefandxm> wrote an ETL software once that pushed quite a lot of data through pure sql and had to rewrite from prepared statements to stringbuilder crap
[06:25:32] <stefandxm> quite horrible. but the speed gain was insane in a couple of databases/drivers
[06:31:40] <akiba__> WITH sel AS ( SELECT id FROM categories WHERE name=$1 AND source=$2 ), ins AS ( INSERT INTO categories (name, source, created_at, updated_at ) SELECT $1, $2, 'now', 'now' WHERE NOT EXISTS (SELECT * FROM sel) RETURNING id ) SELECT id FROM ins UNION ALL SELECT id FROM sel;
[07:12:19] <stefandxm> mongodb and many other "no sql databases" will not have transactions
[07:12:54] <stefandxm> this means that you wont get an application lock on the data you are operating on, from the database. so you must implement it yourself
[07:13:02] <stefandxm> in a single threaded, single instance application this is trivial
[07:13:12] <stefandxm> in a highly parallell application it may not be that trivial
[07:20:50] <stefandxm> but sql is very well developed and there are alot of resources if you get stuck
[07:21:20] <stefandxm> tbh sql is a pain in the ass. the language is horrible for applications. you might want to use an ORM
[07:21:42] <stefandxm> but since you are quite new to stuff i dont want to recommend you to go all highlevel since you might not understand your own problems
[07:45:12] <akiba__> so how would i use it in java?
[07:46:05] <sellout> I could see hashing usernames for obscurity (like, making it harder for a hacker to figure out who the users on your porn site are), but if you’re storing billing info, or full names / display names or other identifiable stuff, it’s not helpful.
[07:48:16] <sellout> And, you can’t salt them (so you can’t use bcrypt), because then you couldn’t look them up, and dictionary attacks are probably pretty effective against usernames, so unsalted isn’t too useful either.
[07:48:26] <partycoder> there's a difference between hashing and encryption
[07:48:32] <sellout> But, I haven’t really thought about it at all, so *shrug*
[12:52:37] <AliRezaTaleghani> maybe I should start balance and let it to move it self on a safe position :-/
[14:20:12] <salty-horse> hey. I moved my sharded database to a different address. it there a way to tell mongoconf that the shards have a new address? I see commands to create new empty shards, but I don't thin that's appropriate
[18:32:31] <richthegeek_> I have a system which uses multiple databases (multitenant so one per account). How is it recommended to do connections in such a system? At the moment I have one per database (literally creating a new MongoDB.Server and MongoDB.DB using that server)
[18:32:52] <richthegeek_> but it's possible to both reuse the server, and to call db.getSiblingDb to get a database
[18:33:00] <richthegeek_> should I be doing that? or does it generally make no difference?
[18:34:36] <richthegeek_> in MMS it's listing ~140 connections (14 databases, minimum of 3 collections and typically ~10 or so used per db) - would reducing the number reduce memory usage or alter performance?
[18:38:11] <richthegeek_> well just tried it getting a "a server cant be shared across multiple Db instances" so thats simple enough
[18:40:59] <richthegeek_> so i guess that has me wondering: why do i have 140 connections when I have only 14 databases and 2 processes connected (plus 2 repl sets)
[19:02:46] <richthegeek_> ok, changed to using a single MongoClient per host/port combo (yay bluebird) and now i have only 31 active connections :D
[20:39:15] <noizex> hi, anyone tried compiling latest legacy mongo c++ driver source on windows using cl.exe?
[20:43:49] <Zelest> Derick, is there any known issues I could run in two if I run a replicaset with mixed versions? e.g, 2.4.10 and 2.6.3 ?
[20:44:09] <Zelest> I assume it's not recommended, but is it posisble?
[20:50:45] <noizex> weird, it looks like that mongoclient source misses a lot of header includes :/
[20:51:14] <noizex> I wonder if anyone even tried to compile it on windows ;)
[21:22:48] <Peavey_> Does anyone know of any settings to reduce the startup time for MongoDB in terms of opening connections to all of its DB files?