class_docstr: Base class for caching in database.
  Includes low-level idea of caching data using relational database.
  
  :param main_table: table to store into or load from
  :param cache_dir: path to the place where cache files should be stored.
  :param use_stats: bool indicating if it is needed to use cache performance dict
  :param stats_keys: sequence of keys for supporting cache effectiveness
class_docstr_tok: ["Base","class","for","caching","in","database",".","Includes","low-level","idea","of","caching","data","using","relational","database",".",":","param","main_table",":","table","to","store","into","or","load","from",":","param","cache_dir",":","path","to","the","place","where","cache","files","should","be","stored",".",":","param","use_stats",":","bool","indicating","if","it","is","needed","to","use","cache","performance","dict",":","param","stats_keys",":","sequence","of","keys","for","supporting","cache","effectiveness"]
code: def __len__(self):
      with closing(sqlite3.connect(self.db_path)) as conn:
          with conn:
              cur = conn.cursor()
              cur.execute(f"SELECT id FROM {self._main_table};")
              all_rows = cur.fetchall()
              return len(all_rows)
  
file_path: FEDOT/fedot/core/caching/base_cache_db.py
imports: import os
  import sqlite3
  from contextlib import closing
  from pathlib import Path
  from typing import Optional, Sequence, Tuple
  import psutil
  from fedot.core.utils import default_fedot_data_dir
label_desc: Use image node_id 10 for calling the BaseCacheDB obj's underlying member method code with example usage: obj.__len__() and returns: len