@Override
  public long countPathsUsingTemplate(final int templateId, final PathPatternTree patternTree)
      throws MetadataException {
    long result = 0;
    for (final PartialPath pathPattern : patternTree.getAllPathPatterns()) {
      result += mTree.countPathsUsingTemplate(pathPattern, templateId);
    }
    return result;
  }
remove the node from the tag inverted index
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/impl/SchemaRegionMemoryImpl.java