message: Fix timing thread: Do not insert keys on every action
diff: @@ -1172,32 +1172,25 @@ impl Timing {
  let context_id = self.current_context.as_ref().map(|(id, _)| id.as_str());
  let query_name = query.query_kind.to_str();
  - let (root, key_id) = if query.key.is_empty() {
  - (None, None)
  - } else {
  - let key = query.key.as_str();
  -
  - let root = match key.split_once('/') {
  - Some(slice) => slice.0,
  - None => key,
  + let root = match query.key.as_str().split_once('/') {
  + Some((root, _)) if !root.is_empty() => Some(root),
  + _ => None,
  };
  - let mut stmt = sql.prepare_cached("INSERT OR IGNORE INTO keys (key) VALUES (?1)")?;
  + // TODO - TE-261: disabled for now because it is not used for anything
  + // Re-enable once needed, and maybe add a command-line flag for it.
  + // We probably want to also add some kind of garbage collection to only keep
  + // values for the last N cycles, and not everything since the beginning.
  + if false {
  + let key = query.key.as_str();
  + let mut stmt = sql.prepare_cached("INSERT OR IGNORE INTO keys (key) VALUES (?1)")?;
  stmt.execute([key])?;
  let mut stmt = sql.prepare_cached("SELECT id FROM keys WHERE key = ?1;")?;
  let key_id: usize = stmt.query_row([key], |row| row.get(0))?;
  - (Some(root), Some(key_id))
  - };
  -
  - // TODO - TE-261: disabled for now because it is not used for anything
  - // Re-enable once needed, and maybe add a command-line flag for it.
  - // We probably want to also add some kind of garbage collection to only keep
  - // values for the last N cycles, and not everything since the beginning.
  - if false {
  if let Some(transaction) = transaction.as_ref() {
  let mut stmt = transaction.prepare_cached(
  "
  