anchor.diff:      db_match_erase(val({Tab, storage_type}), Tab, Pat).
   db_match_erase(ram_copies, Tab, Pat) -> ?ets_match_delete(Tab, Pat), ok;
   db_match_erase(disc_copies, Tab, Pat) -> ?ets_match_delete(Tab, Pat), ok;
  -db_match_erase(disc_only_copies, Tab, Pat) -> dets:match_delete(Tab, Pat).
  +db_match_erase(disc_only_copies, Tab, Pat) -> dets:match_delete(Tab, Pat);
  +db_match_erase({ext, Alias, Mod}, Tab, Pat) ->
  +    Mod:match_delete(Alias, Tab, Pat),
  +    ok.
   
   db_delete_all(ram_copies, Tab) ->       ets:delete_all_objects(Tab);
   db_delete_all(disc_copies, Tab) ->      ets:delete_all_objects(Tab);
  
positive.code: db_update_counter(disc_copies, Tab, C, Val) ->
      ?ets_update_counter(Tab, C, Val);
  db_update_counter(disc_only_copies, Tab, C, Val) ->
      dets:update_counter(Tab, C, Val).
  
  db_erase_tab(Tab) ->
      db_erase_tab(val({Tab, storage_type}), Tab).
  db_erase_tab(ram_copies, Tab) -> ?ets_delete_table(Tab);
  db_erase_tab(disc_copies, Tab) -> ?ets_delete_table(Tab);
  db_erase_tab(disc_only_copies, _Tab) -> ignore.
  
  %% assuming that Tab is a valid ets-table
  dets_to_ets(Tabname, Tab, File, Type, Rep, Lock) ->
  
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) ->
  