Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

too slow when application running,version:4.0.0-RC1 #2394

Closed
Li-Turing opened this issue May 16, 2019 · 6 comments
Closed

too slow when application running,version:4.0.0-RC1 #2394

Li-Turing opened this issue May 16, 2019 · 6 comments
Assignees

Comments

@Li-Turing
Copy link

Li-Turing commented May 16, 2019

application run slowly when i use default-datasource-name

shardingsphere will load shardingContext and connect to db,why do this?

there is much tables and colums, when shardingsphere do it,it is slow

my configuration:
check.table.matedata.enable:false

slow function:
loadDefaultTables()

@SneakyThrows
public Map<String, TableMetaData> load(final ShardingRule shardingRule) {
Map<String, TableMetaData> result = new HashMap<>();
result.putAll(loadShardingTables(shardingRule));
result.putAll(loadDefaultTables(shardingRule));
return result;
}

this function is slow

@Li-Turing Li-Turing changed the title slow too slow when application running May 16, 2019
@Li-Turing Li-Turing changed the title too slow when application running too slow when application running,version:4.0.0-RC1 May 16, 2019
@Li-Turing
Copy link
Author

@tristaZero

@tristaZero
Copy link
Contributor

Hi, instead of loading the metadata from all of sharding tables and checking them,
check.table.matedata.enable:false will make Sharding Sphere only load the meta data from one sharding table and all tables from default data source. Because we need the metadata of sharding table.
So it is not a bug, but an optimization item. Please refer to #1951.
If you're interested in it, please try to do it.

@MidnightFiend
Copy link

with RC1 , i find it load all table in the pointed db, which is not configured in "logic-tables=user,order,...".

is there any way to optimize the problem?

@MidnightFiend
Copy link

i had try this way. it`s not work. still go to get all table column metadata.

<sharding:data-source id="shardingDataSource">
    <sharding:props>
        <prop key="check.table.metadata.enabled">false</prop>
    </sharding:props>
...

@Fermiz
Copy link

Fermiz commented Feb 21, 2020

@tristaZero as you said, Sharding Sphere only load the meta data from one sharding table and all tables from default data source , when the tables from default data source are to many, it would take about 2 mins during application initialization, it's two slow for continuous deploying, is there any idea to extend or remove result.putAll(loadDefaultTables(shardingRule));? I saw a lot of issues are related to this, looking forward to it, thanks

@wephone
Copy link

wephone commented Mar 4, 2020

check.table.matedata.enable:false is just only for sharding tables,my default datasource contains too many tables,this tables doesnt need sharding, but loadDefaultTables() took me an hour to boot my project.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants