News for hackers. Stuff that matters.
Re:Wolfram Alpha’s New Data about Pokémon by klodolph on Thursday October 17, 2013 @01:22AM (#6563824)
> no wonder people like key-value stores

You're doing a relational query: select, join, project. Translate it to a key-value store and you're going to end up with way more boilerplate. Using a key-value store for a relational query is like trying to use a screwdriver to drive a nail.

Re:Wolfram Alpha’s New Data about Pokémon by mappu on Thursday October 17, 2013 @01:47AM (#6563858)
It definitely suits a relational query.

But assuming you have indexes `pokemon_learn_moves_by_move_id` and `moves_by_name`, you could write

    pokemon_learn_moves_by_move_id[ moves_by_name["Hydro Pump"].id ]
        .map( |id| [pokemon[id].sp_atk, pokemon[id].name] )
        .greatest()[1];
(using a hypothetical system) which i think is a bit less boilerplate. Although, now i've explicitly written an execution plan rather than letting the SQL engine decide (i had `sort()[0]` there instead of `greatest()` for a while, which i think sums up why the SQL approach is generally better).