{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/16265","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/16265/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/16265/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/16265/events","html_url":"https://github.com/yiisoft/yii2/issues/16265","id":322504455,"number":16265,"title":"increase mysql load in 2.0.14.2 version","user":{"login":"sepidemahmoodi","id":16792374,"avatar_url":"https://avatars2.githubusercontent.com/u/16792374?v=4","gravatar_id":"","url":"https://api.github.com/users/sepidemahmoodi","html_url":"https://github.com/sepidemahmoodi","followers_url":"https://api.github.com/users/sepidemahmoodi/followers","following_url":"https://api.github.com/users/sepidemahmoodi/following{/other_user}","gists_url":"https://api.github.com/users/sepidemahmoodi/gists{/gist_id}","starred_url":"https://api.github.com/users/sepidemahmoodi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sepidemahmoodi/subscriptions","organizations_url":"https://api.github.com/users/sepidemahmoodi/orgs","repos_url":"https://api.github.com/users/sepidemahmoodi/repos","events_url":"https://api.github.com/users/sepidemahmoodi/events{/privacy}","received_events_url":"https://api.github.com/users/sepidemahmoodi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-12T11:38:22Z","updated_at":"2018-05-12T12:11:24Z","closed_at":"2018-05-12T11:41:03Z","author_association":"NONE","body":"\r\nHi,\r\ni was updated my core to 2.0.14.2 version,\r\nthen mysql load was increased while cache is enabled,\r\nit seems this query makes it\r\n\r\n\r\n`   Id: 180216\r\n   User: portal\r\n   Host: localhost\r\n     db: portal\r\nCommand: Query\r\n   Time: 20\r\n  State: Opening tables\r\n\r\n   Info: SELECT\r\n    `kcu`.`CONSTRAINT_NAME` AS `name`,\r\n    `kcu`.`COLUMN_NAME` AS `column_name`,\r\n    `tc`.`CONSTRAINT_TYPE` AS `type`,\r\n\r\n    CASE\r\n\r\n        WHEN NULL IS NULL AND `kcu`.`REFERENCED_TABLE_SCHEMA` = DATABASE() THEN NULL\r\n        ELSE `kcu`.`REFERENCED_TABLE_SCHEMA`\r\n    END AS `foreign_table_schema`,\r\n    `kcu`.`REFERENCED_TABLE_NAME` AS `foreign_table_name`,\r\n    `kcu`.`REFERENCED_COLUMN_NAME` AS `foreign_column_name`,\r\n    `rc`.`UPDATE_RULE` AS `on_update`,\r\n    `rc`.`DELETE_RULE` AS `on_delete`,\r\n    `kcu`.`ORDINAL_POSITION` AS `position`\r\nFROM\r\n\r\n    `information_schema`.`KEY_COLUMN_USAGE` AS `kcu`,\r\n    `information_schema`.`REFERENTIAL_CONSTRAINTS` AS `rc`,\r\n    `information_schema`.`TABLE_CONSTRAINTS` AS `tc`\r\nWHERE\r\n\r\n    `kcu`.`TABLE_SCHEMA` = COALESCE(NULL, DATABASE()) AND `kcu`.`CONSTRAINT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `kcu`.`TABLE_NAME` = 'session'\r\n    AND `rc`.`CONSTRAINT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `rc`.`TABLE_NAME` = 'session' AND `rc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME`\r\n    AND `tc`.`TABLE_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `tc`.`TABLE_NAME` = 'session' AND `tc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` AND `tc`.`CONSTRAINT_TYPE` = 'FOREIGN KEY'\r\n\r\nUNION\r\n\r\nSELECT\r\n\r\n    `kcu`.`CONSTRAINT_NAME` AS `name`,\r\n    `kcu`.`COLUMN_NAME` AS `column_name`,\r\n    `tc`.`CONSTRAINT_TYPE` AS `type`,\r\n    NULL AS `foreign_table_schema`,\r\n    NULL AS `foreign_table_name`,\r\n    NULL AS `foreign_column_name`,\r\n    NULL AS `on_update`,\r\n    NULL AS `on_delete`,\r\n    `kcu`.`ORDINAL_POSITION` AS `position`\r\n\r\nFROM\r\n\r\n    `information_schema`.`KEY_COLUMN_USAGE` AS `kcu`,\r\n    `information_schema`.`TABLE_CONSTRAINTS` AS `tc`\r\n\r\nWHERE\r\n\r\n    `kcu`.`TABLE_SCHEMA` = COALESCE(NULL, DATABASE()) AND `kcu`.`TABLE_NAME` = 'session'\r\n    AND `tc`.`TABLE_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `tc`.`TABLE_NAME` = 'session' AND `tc`.`CONSTRAINT_NAME` = `kcu`.`CONSTRAINT_NAME` AND `tc`.`CONSTRAINT_TYPE` IN ('PRIMARY KEY', 'UNIQUE')\r\nORDER BY `position` ASC`\r\n\r\nhow to solve it?\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/388550855","html_url":"https://github.com/yiisoft/yii2/issues/16265#issuecomment-388550855","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/16265","id":388550855,"user":{"login":"sepidemahmoodi","id":16792374,"avatar_url":"https://avatars2.githubusercontent.com/u/16792374?v=4","gravatar_id":"","url":"https://api.github.com/users/sepidemahmoodi","html_url":"https://github.com/sepidemahmoodi","followers_url":"https://api.github.com/users/sepidemahmoodi/followers","following_url":"https://api.github.com/users/sepidemahmoodi/following{/other_user}","gists_url":"https://api.github.com/users/sepidemahmoodi/gists{/gist_id}","starred_url":"https://api.github.com/users/sepidemahmoodi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sepidemahmoodi/subscriptions","organizations_url":"https://api.github.com/users/sepidemahmoodi/orgs","repos_url":"https://api.github.com/users/sepidemahmoodi/repos","events_url":"https://api.github.com/users/sepidemahmoodi/events{/privacy}","received_events_url":"https://api.github.com/users/sepidemahmoodi/received_events","type":"User","site_admin":false},"created_at":"2018-05-12T12:11:24Z","updated_at":"2018-05-12T12:11:24Z","author_association":"NONE","body":"@samdark please reopen the issue"}}
{"actor":{"display_login":"sepidemahmoodi"}}