docs: public static void updateUsageAnnotations(Database db,
                                                Statement stmt,
                                                AbstractPlanNode topPlan,
                                                AbstractPlanNode bottomPlan)
      {
          Map<String, StmtTargetTableScan> tablesRead = new TreeMap<>();
          Collection<String> indexes = new TreeSet<>();
          if (topPlan != null) {
              topPlan.getTablesAndIndexes(tablesRead, indexes);
          }
          if (bottomPlan != null) {
              bottomPlan.getTablesAndIndexes(tablesRead, indexes);
          }
  
          String updated = "";
          if ( ! stmt.getReadonly()) {
              updated = topPlan.getUpdatedTable();
              if (updated == null) {
                  updated = bottomPlan.getUpdatedTable();
              }
              assert(updated.length() > 0);
          }
  
          Set<String> readTableNames = tablesRead.keySet();
          stmt.setTablesread(StringUtils.join(readTableNames, ","));
          stmt.setTablesupdated(updated);
  
          Set<String> tableDotIndexNames = new TreeSet<>();
  
          for (Table table : db.getTables()) {
              if (readTableNames.contains(table.getTypeName())) {
                  readTableNames.remove(table.getTypeName());
                  for (String indexName : indexes) {
                      Index index = table.getIndexes().get(indexName);
                      if (index != null) {
                          tableDotIndexNames.add(table.getTypeName() + "." + index.getTypeName());
                      }
                  }
              }
          }
  
          String indexString = StringUtils.join(tableDotIndexNames, ",");
          stmt.setIndexesused(indexString);
  
          assert(tablesRead.size() == 0);
      }