anchor.diff:      {_Schema,Table,_Alias} = hd(Stmt#statement.tables),
       catch if_call_mfa(false,unsubscribe,[none,{table,Table,simple}]).
   
  +kill_fetch(undefined, undefined) -> ok;
   kill_fetch(MonitorRef, Pid) ->
       catch erlang:demonitor(MonitorRef, [flush]),
       catch Pid ! abort. 
  
positive.code:     case FetchCtx0#fetchCtx.status of
          fetching ->
              io:format(user, "~p - late end of table received in state~n~p~n", [?MODULE, State]),        
              imem_meta:log_to_db(warning,?MODULE,handle_info,[{row, ?eot}],"eot"),
              send_reply_to_client(Sock, {[],true}),  
              handle_fetch_complete(State);
          _ ->
  
negative.code:     FBound = select_bind(MetaRec, FGuard, MBinds),
      % io:format(user,"FBound : ~p~n", [FBound]),
      Filter = make_filter_fun(1,FBound, FBinds),
      SkipFetch = lists:member({fetch_mode,skip},Opts),
      case {SkipFetch,FetchCtx0#fetchCtx.pid} of
          {true,undefined} ->     %% skip fetch
              FetchSkip = #fetchCtx{status=undefined,metarec=MetaRec,blockSize=BlockSize,remaining=Limit,opts=Opts,filter=Filter,tailSpec=TailSpec},
              handle_fetch_complete(State#state{reply=Sock,fetchCtx=FetchSkip}); 
          {false,undefined} ->    %% start fetch
              case if_call_mfa(IsSec, fetch_start, [SKey, self(), Table, SSpec, BlockSize, Opts]) of
                  TransPid when is_pid(TransPid) ->
                      MonitorRef = erlang:monitor(process, TransPid),
                      TransPid ! next,
                      % io:format(user, "~p - fetch opts ~p~n", [?MODULE,Opts]), 
                      FetchStart = #fetchCtx{pid=TransPid,monref=MonitorRef,status=waiting,metarec=MetaRec,blockSize=BlockSize,remaining=Limit,opts=Opts,filter=Filter,tailSpec=TailSpec},
                      {noreply, State#state{reply=Sock,fetchCtx=FetchStart}}; 
                  Error ->    
                      ?SystemException({"Cannot spawn async fetch process",Error})
              end;
          {true,_Pid} ->          %% skip ongoing fetch (and possibly go to tail_mode)
              FetchSkipRemaining = FetchCtx0#fetchCtx{metarec=MetaRec,opts=Opts,filter=Filter,tailSpec=TailSpec},
              handle_fetch_complete(State#state{reply=Sock,fetchCtx=FetchSkipRemaining}); 
          {false,Pid} ->          %% fetch next block
              Pid ! next,
              % io:format(user, "~p - fetch opts ~p~n", [?MODULE,Opts]),
              FetchContinue = FetchCtx0#fetchCtx{metarec=MetaRec,opts=Opts,filter=Filter,tailSpec=TailSpec}, 
              {noreply, State#state{reply=Sock,fetchCtx=FetchContinue}}  
      end;
  handle_cast({close, _SKey}, State) ->
      imem_meta:log_to_db(debug,?MODULE,handle_cast,[],"close statement"),
      % io:format(user, "~p - received close in state ~p~n", [?MODULE, State]),
  