anchor.diff:             child_module = ChildModule,
              child_state = ChildState}.
   
  -init_after_ack(State) ->
  +init_after_ack(State = #state{name = TableName}) ->
       ok = open(State),
  -    State.
  +    Revisions = ets:new(ok, [set, private]),
  +    MatchSpec = [{#doc{id = '$1', rev = '$2', _ = '_'}, [], [{{'$1', '$2'}}]}],
  +
  +    Start = os:timestamp(),
  +    select_from_dets_locked(TableName, MatchSpec, 100,
  +                            fun (Selection) ->
  +                                    ets:insert_new(Revisions, Selection)
  +                            end),
  +    ?log_debug("Loading ~p items, ~p words took ~pms",
  +               [ets:info(Revisions, size),
  +                ets:info(Revisions, memory),
  +                timer:now_diff(os:timestamp(), Start) div 1000]),
  +
  +    State#state{revisions = Revisions}.
   
   open(#state{path = Path, name = TableName}) ->
  +    ?log_debug("Opening file ~p", [Path]),
       {ok, TableName} =
           dets:open_file(TableName,
                          [{type, set},
  
positive.code: -record(state, {child_module :: atom(),
                  child_state :: term(),
                  path :: string(),
                  name :: atom()}).
  
  -record(doc, {id :: term(),
                rev :: term(),
  
negative.code:     end;
  handle_call(empty, _From, #state{name = TableName,
                                   child_module = ChildModule,
                                   child_state = ChildState,
                                   revisions = Revisions} = State) ->
      ok = dets:delete_all_objects(TableName),
      true = ets:delete_all_objects(Revisions),
      mru_cache:flush(TableName),
      NewChildState = ChildModule:on_empty(ChildState),
      {reply, ok, State#state{child_state = NewChildState}};
  