anchor.diff:              f ba (ba.Length - 1)
               ba
   
  -        let getStmtForIndex p =
  -            let (ndx,b) = 
  -                match p with
  -                | plan.q.Plan (ndx,b) -> (ndx,b)
  -
  +        let getStmtForIndex ndx b =
               //printfn "ndx: %A" ndx
               //printfn "bounds: %A" b
   
  
positive.code: 
              {docs=s; funk=killFunc}
  
          let getIndexScanReader tx db coll ndxu =
              let stmt = getStmtForIndex ndxu
  
              let s = getStmtSequence stmt
  
              let killFunc() =
                  // TODO would it be possible/helpful to make sure this function
                  // can be safely called more than once?
                  if tx then conn.exec("COMMIT TRANSACTION")
                  stmt.sqlite3_finalize()
  
              {docs=s; funk=killFunc}
  
          let getSeq tx db coll plan =
              match getCollectionOptions db coll with
  
negative.code:                 if tx then conn.exec("BEGIN TRANSACTION")
  
                  match plan with
                  | Some ndxu -> getIndexScanReader tx ndxu
                  | None -> getTableScanReader tx db coll
              | None ->
                  {docs=Seq.empty; funk=(fun () -> ())}
  