DLu/dominionstats — comment on commit 264834f0d211406bb537ae338ff9d9f2d22eaba0
File: goals.py line 356
By DLu:

Fixed, i think. I just figured out how to use mongo syntactically, not
effectively. I like this structure more anyway.

On Fri, Nov 4, 2011 at 11:43 PM, Rob Renaud <
reply@reply.github.com>wrote:

> I think this operation requires a full DB scan. Before it was searching
> on an indexed field, but you can't index the field if you don't know the
> 'object path' to the data you want, and if the player name is itself part
> of the 'object path', then you just can't index it ahead of time with mongo.
>
> In general, I think it would be better to have a list of goals achieved
> per game,
>
> Rather than your current structure of
>
> GoalDoc
> variable_player_name ->
> variable_goal_name ->
> player_name
> reason
>
> GoalDoc ->
> _id
> achievements ->
> norm_name
> goal_name
> reason
>
> The second representation also avoids namespace collision issues in the
> object, we can add first level meta data to the goal doc without working
> that we collide with a player name.
>
> ---
> Reply to this email directly or view it on GitHub:
>
> https://github.com/DLu/dominionstats/commit/264834f0d211406bb537ae338ff9d9f2d22eaba0#commitcomment-697149
>