You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/07/02 05:14:40 UTC

[GitHub] [shardingsphere] tuohai666 commented on issue #6212: Optimize startup time, control which tables can load when startup

tuohai666 commented on issue #6212:
URL: https://github.com/apache/shardingsphere/issues/6212#issuecomment-652786884


   We have received several similar reports about the slow startup recently, mostly due to loading unconfigured tables for meta data purpose of ShardingSphere.
   
   https://github.com/apache/shardingsphere/issues/6179 : 7000+ tables cost much time.
   Similar issues: https://github.com/apache/shardingsphere/issues/5755 , https://github.com/apache/shardingsphere/issues/5999 .
   
   Loading table (column and index information) is expensive, there're 7 SQLs interactive for each table.
   ![image](https://user-images.githubusercontent.com/24643893/86317891-24003900-bc63-11ea-9bb9-9d6ffbaa0316.png)
   
   After investigate, I found that for tables unconfigured will not use column or index information any more after loading. So we can omit this process. 
   
   I also checked the relevant issue https://github.com/apache/shardingsphere/issues/4460 , which will load collation for all columns in every table. If a table is unconfigured, the route result must be single route, a single route will not need merge any more. If the resultset does not need to merge, it is irrelevant with cache of collation. So I think we can safely remove the loading of unconfigured tables now.
   
   Note that all unconfigured table names still need to be loaded for routing logic, this can simply obtain from one SQL for each 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.

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