finish schema, query, algorithm