let index_by_name_opt = fun db name ->
    try
      Some (List.find (fun i -> i.idx_name = name) db.db_indexes)
    with
      | Not_found -> None