anchor.diff:      try
   	case Storage of
   	    disc_only_copies -> dets:match_object(Tab, Pat);
  +	    {ext, Alias, Mod} -> Mod:select(Alias, Tab, [{Pat, [], ['$_']}]);
   	    _ -> ets:match_object(Tab, Pat)
   	end
       after
   	db_fixtable(Storage, Tab, false)
       end.
  +
  +db_foldl(Fun, Acc, Tab) ->
  +    db_foldl(val({Tab, storage_type}), Fun, Acc, Tab).
  +
  +db_foldl(Storage, Fun, Acc, Tab) ->
  +    Limit = mnesia_monitor:get_env(fold_chunk_size),
  +    db_foldl(Storage, Fun, Acc, Tab, [{'_', [], ['$_']}], Limit).
  +
  +db_foldl(ram_copies, Fun, Acc, Tab, Pat, Limit) ->
  +    mnesia_lib:db_fixtable(ram_copies, Tab, true),
  +    try select_foldl(db_select_init(ram_copies, Tab, Pat, Limit),
  +		     Fun, Acc, ram_copies)
  +    after
  +	mnesia_lib:db_fixtable(ram_copies, Tab, false)
  +    end;
  +db_foldl(Storage, Fun, Acc, Tab, Pat, Limit) ->
  +    select_foldl(mnesia_lib:db_select_init(Storage, Tab, Pat, Limit), Fun, Acc, Storage).
  +
  +select_foldl({Objs, Cont}, Fun, Acc, Storage) ->
  +    select_foldl(mnesia_lib:db_select_cont(Storage, Cont, []),
  +	      Fun, lists:foldl(Fun, Acc, Objs), Storage);
  +select_foldl('$end_of_table', _, Acc, _) ->
  +    Acc.
   
   db_select(Tab, Pat) ->
       db_select(val({Tab, storage_type}), Tab, Pat).
  
positive.code: 	    no -> {node_not_running, node()};
  	    _ -> {no_exists, Var}
  	end,
      verbose("~p (~p) val(mnesia_gvar, ~w) -> ~p ~n",
  	    [self(), process_info(self(), registered_name),
  	     Var, Why]),
      mnesia:abort(Why).
  
  %% Some functions for list valued variables
  
negative.code:     db_get(val({Tab, storage_type}), Tab, Key).
  db_get(ram_copies, Tab, Key) -> ?ets_lookup(Tab, Key);
  db_get(disc_copies, Tab, Key) -> ?ets_lookup(Tab, Key);
  db_get(disc_only_copies, Tab, Key) -> dets:lookup(Tab, Key);
  db_get({ext, Alias, Mod}, Tab, Key) ->
      Mod:lookup(Alias, Tab, Key).
  
  db_init_chunk(Tab) ->
      db_init_chunk(val({Tab, storage_type}), Tab, 1000).
  db_init_chunk(Tab, N) ->
      db_init_chunk(val({Tab, storage_type}), Tab, N).
  
  db_init_chunk({ext, Alias, Mod}, Tab, N) ->
      Mod:select(Alias, Tab, [{'_', [], ['$_']}], N);
  db_init_chunk(disc_only_copies, Tab, N) ->
      dets:select(Tab, [{'_', [], ['$_']}], N);
  db_init_chunk(_, Tab, N) ->
      ets:select(Tab, [{'_', [], ['$_']}], N).
  
  db_chunk({ext, _Alias, Mod}, State) ->
      Mod:select(State);
  db_chunk(disc_only_copies, State) ->
      dets:select(State);
  db_chunk(_, State) ->
  