yuqi1129 commented on code in PR #9430:
URL: https://github.com/apache/gravitino/pull/9430#discussion_r2661277278


##########
core/src/main/java/org/apache/gravitino/storage/relational/service/FilesetMetaService.java:
##########
@@ -125,15 +119,37 @@ public FilesetEntity 
getFilesetByIdentifier(NameIdentifier identifier) {
   public List<FilesetEntity> listFilesetsByNamespace(Namespace namespace) {
     NamespaceUtil.checkFileset(namespace);
 
+    List<FilesetPO> filesetPOs = listFilesetPOs(namespace);
+    return POConverters.fromFilesetPOs(filesetPOs, namespace);
+  }
+
+  private List<FilesetPO> listFilesetPOs(Namespace namespace) {
+    return filesetListFetcher().apply(namespace);
+  }
+
+  private List<FilesetPO> listFilesetPOsBySchemaId(Namespace namespace) {

Review Comment:
   I have used the following SQL
   
   
   ```sql
   SELECT mm.metalake_id AS metalakeId, cm.catalog_id AS catalogId, 
sm.schema_id AS schemaId, vi.fileset_id AS filesetId, fm.fileset_name AS 
filesetName, fm.type AS type, fm.audit_info AS auditInfo, fm.current_version AS 
currentVersion, fm.last_version AS lastVersion, fm.deleted_at as deletedAt, 
vi.id, vi.metalake_id as version_metalake_id, vi.catalog_id as 
version_catalog_id, vi.schema_id as version_schema_id, vi.fileset_id as 
version_fileset_id, vi.version, vi.fileset_comment, vi.properties, 
vi.storage_location_name, vi.storage_location, vi.deleted_at as 
version_deleted_at FROM metalake_meta mm INNER JOIN catalog_meta cm ON 
mm.metalake_id = cm.metalake_id AND cm.catalog_name = 'fileset_catalog' AND 
cm.deleted_at = 0 LEFT JOIN schema_meta sm ON cm.catalog_id = sm.catalog_id AND 
sm.schema_name = 'schema' AND sm.deleted_at = 0 LEFT JOIN fileset_meta fm ON 
sm.schema_id = fm.schema_id AND fm.deleted_at = 0 LEFT JOIN 
fileset_version_info vi ON fm.fileset_id = vi.fileset_id AND fm.current
 _version = vi.version AND vi.deleted_at = 0 WHERE mm.metalake_name = 'test' 
AND mm.deleted_at = 0;
   ```
   and 
   ```
   SELECT fm.fileset_id, fm.fileset_name, fm.metalake_id, fm.catalog_id, 
fm.schema_id,
   fm.type, fm.audit_info, fm.current_version, fm.last_version, fm.deleted_at, 
vi.id, vi.metalake_id as version_metalake_id, vi.catalog_id as 
version_catalog_id, vi.schema_id as version_schema_id, vi.fileset_id as 
version_fileset_id, vi.version, vi.fileset_comment, vi.properties, 
vi.storage_location_name, vi.storage_location, vi.deleted_at as 
version_deleted_at
   FROM fileset_meta fm INNER JOIN fileset_version_info vi ON fm.fileset_id = 
vi.fileset_id AND fm.current_version = vi.version WHERE fm.schema_id = 
1824238720785109989 AND fm.fileset_name = 'test' AND fm.deleted_at = 0 AND 
vi.deleted_at = 0;
   ```
   
   The average time for the first one is 22ms, and the second one is 
approximately 12ms. 
   
   Environment:
   
   1. Local MySQL instance
   2. 1000 fileset with one database. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to