Open sepidemahmoodi opened 6 years ago
That's schema cache. If caching schema is enabled, this query should not happen more than once. Check your config.
yes, schema cache is enable but it takes too much time to load page for first time, actually in previous yii version i didnt have this problem. this query makes down my website
@samdark please reopen the issue
Would you please try code from master first?
same problem was happened :( cache process takes long time and cause down my website
my application has thousand subdomain and each of them has own database, when application loaded for first time in mysql process list that query has shown. so a large number of databases and load all of them cause this problem.
As a workaround, you can try warming up these DBs one by one. That's one time action and should not cause issues as long as cache is filled.
this query in 2.0.13.1 version of yii2 has no problem and this query took 0.0004(s) in mysql,
SELECT kcu.constraint_name, kcu.column_name, kcu.referenced_table_name, kcu.referenced_column_name FROM information_schema.referential_constraints AS rc JOIN information_schema.key_column_usage AS kcu ON ( kcu.constraint_catalog = rc.constraint_catalog OR (kcu.constraint_catalog IS NULL AND rc.constraint_catalog IS NULL) ) AND kcu.constraint_schema = rc.constraint_schema AND kcu.constraint_name = rc.constraint_name WHERE rc.constraint_schema = database() AND kcu.table_schema = database() AND rc.table_name = 'session' AND kcu.table_name = 'session'
but query of version 2.0.14.2 took 12.64(s) time in mysql. im checking thats warming up databases solution,
What's your MySQL version btw?
5.7.22
I have the same problem and I didn't have problem in 2.0.13.1. It seems it's getting all Ram capacity and even swap memory and it increasing server load caused by mysql.scheme caching is slow and because it's running for multi database at the same time, it causes overloading.
Hi, i was updated my core to 2.0.14.2 version, then mysql load was increased while cache is enabled, it seems this query makes it
how to solve it?