ygerzhedovich commented on code in PR #4434:
URL: https://github.com/apache/ignite-3/pull/4434#discussion_r1776808579


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/schema/SqlSchemaManagerImpl.java:
##########
@@ -101,10 +109,12 @@ public SqlSchemaManagerImpl(CatalogManager 
catalogManager, CacheFactory factory,
     /** {@inheritDoc} */
     @Override
     public SchemaPlus schema(int catalogVersion) {
-        return schemaCache.get(
+        SchemaPlus schemaPlus = schemaCache.get(
                 catalogVersion,
                 version -> createRootSchema(catalogManager.catalog(version))
         );
+
+        return makeSchemaCopyWithStatisticSnapshot(schemaPlus, catalogVersion);

Review Comment:
   Unfortunately, we don't have now another way to implement it (or I don't 
know such way), due to schema required for execute every SQL and we haver a 
cache for schemas.
   It's lightweight copying. Statistics not calculated every time, just look 
into the constructor of StatisticsSnapshot `new 
Lazy<>(statistic::getRowCount);` - it's lazy evaluation, just for cases when it 
really required.
   Yes, I will provide benchmark results a little bit later.



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to