mchades commented on code in PR #9563:
URL: https://github.com/apache/gravitino/pull/9563#discussion_r2647482837


##########
core/src/main/java/org/apache/gravitino/catalog/CatalogManager.java:
##########
@@ -562,7 +560,7 @@ public void enableCatalog(NameIdentifier ident)
           checkMetalake(metalakeIdent, store);
 
           try {
-            if (catalogInUse(store, ident)) {
+            if (getCatalogInUseValue(store, ident)) {

Review Comment:
   > Also, checking the catalog needs to load and wrap the catalog entity, and 
the load/alter also do the same thing, it relies on the cache to avoid 
accessing the DB twice, but my feeling is that this can be optimized.
   
   Yes, performing `checkCatalogInUse` and `checkMetalakeInUse` from the call 
entry can short-circuit when metalake and catalog are in a "not in-use" state. 
However, in practice, catalogs and metalakes are usually `in-use` most of the 
time, so this actually introduces additional performance overhead in most cases.
   
   Let me take a deep dive into the call chains of various operations, find a 
key call point that doesn't require additional storage access, and discuss it 
with @yuqi1129 offline



-- 
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