anchor.diff:                      {intervals:empty(), []};
                   FirstKey ->
                       %ct:pal("first key: ~.0p~n", [FirstKey]),
  +                    FirstEntry = get_entry_(DB, FirstKey),
  +                    Chunk0 = case FilterFun(FirstEntry) of
  +                                 true -> [ValueFun(FirstEntry)];
  +                                 _    -> []
  +                             end,
                       {Next, Chunk} =
                           get_chunk_inner(DB, ets:next(ETSDB, FirstKey), FirstKey,
  -                                        Interval, ChunkSize - 1, [get_entry_(DB, FirstKey)]),
  +                                        Interval, FilterFun, ValueFun, ChunkSize - 1, Chunk0),
                       case Next of
                           '$end_of_table' ->
                               {intervals:empty(), Chunk};
  
positive.code: %% pre: Current is in ets table, ets table is not empty
  -spec get_chunk_inner(DB::db_t(), Current::?RT:key() | '$end_of_table',
                        RealStart::?RT:key(), Interval::intervals:interval(),
                        ChunkSize::pos_integer(), Chunk::db_as_list())
          -> {?RT:key() | '$end_of_table' | '$end_of_interval', db_as_list()}.
  get_chunk_inner(_DB, RealStart, RealStart, _Interval, _ChunkSize, Chunk) ->
      %ct:pal("inner: 0: ~p", [RealStart]),
      % we hit the start element, i.e. our whole data set has been traversed
      {'$end_of_interval', Chunk};
  get_chunk_inner(_DB, Current, _RealStart, _Interval, 0, Chunk) ->
      %ct:pal("inner: 1: ~p", [Current]),
      % we hit the chunk size limit
      {Current, Chunk};
  get_chunk_inner({ETSDB, _Subscr} = DB, '$end_of_table', RealStart, Interval, ChunkSize, Chunk) ->
      %ct:pal("inner: 2: ~p", ['$end_of_table']),
      % reached end of table - start at beginning (may be a wrapping interval)
      get_chunk_inner(DB, ets:first(ETSDB), RealStart, Interval, ChunkSize, Chunk);
  get_chunk_inner({ETSDB, _Subscr} = DB, Current, RealStart, Interval, ChunkSize, Chunk) ->
      %ct:pal("inner: 3: ~p", [Current]),
      case intervals:in(Current, Interval) of
          true ->
              Entry = get_entry_(DB, Current),
              Next = ets:next(ETSDB, Current),
              get_chunk_inner(DB, Next, RealStart, Interval, ChunkSize - 1, [Entry | Chunk]);
          _ ->
              {'$end_of_interval', Chunk}
      end.
  
negative.code: -type db_t() :: {Table::tid() | atom(), SubscrTable::tid() | atom()}.
  
  % TODO: move these functions to the behaviour and implement them in the other DBs!
  -export([get_chunk/3, get_chunk/5, delete_chunk/3, get_split_key/4]).
  
  % Note: must include db_beh.hrl AFTER the type definitions for erlang < R13B04
  % to work.
  