{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/19708","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/19708/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/19708/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/19708/events","html_url":"https://github.com/joomla/joomla-cms/pull/19708","id":297840241,"number":19708,"title":"[WIP] Session table improvements","user":{"login":"csthomas","id":9054379,"avatar_url":"https://avatars3.githubusercontent.com/u/9054379?v=4","gravatar_id":"","url":"https://api.github.com/users/csthomas","html_url":"https://github.com/csthomas","followers_url":"https://api.github.com/users/csthomas/followers","following_url":"https://api.github.com/users/csthomas/following{/other_user}","gists_url":"https://api.github.com/users/csthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/csthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csthomas/subscriptions","organizations_url":"https://api.github.com/users/csthomas/orgs","repos_url":"https://api.github.com/users/csthomas/repos","events_url":"https://api.github.com/users/csthomas/events{/privacy}","received_events_url":"https://api.github.com/users/csthomas/received_events","type":"User","site_admin":false},"labels":[{"id":60721348,"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-16T16:20:20Z","updated_at":"2018-02-17T10:59:31Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/19708","html_url":"https://github.com/joomla/joomla-cms/pull/19708","diff_url":"https://github.com/joomla/joomla-cms/pull/19708.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/19708.patch"},"body":"### Summary of Changes\r\n1. Change type of column `session_id` from `varchar` to `varbinary`.\r\n2. Change type of column `time` from `varchar` to `integer`.\r\n\r\n**Why I changed `time` column to integer?**\r\nBefore PR the value in `time` column was a text.  Comparing text to text such as \"a\" <'b' can not use the index.\r\nThis way when joomla deletes all expired sessions need to scan all rows because the index is useless.\r\n`varchar` type use language processing on comparision.\r\n`varchar` takes up to 4 bytes per character when it is loaded in RAM.\r\nThe other drawback is when we compare '21' < '110' which may returns false, see #13933\r\n\r\n**Why I changed `session_id` column to varbinary?**\r\nA good explanation is at https://github.com/symfony/http-foundation/blob/master/Session/Storage/Handler/PdoSessionHandler.php#L214\r\n\r\n### Testing Instructions\r\n1. Install staging\r\n2. \r\n   a) Apply additional PR #19707 if you are using postgresql database. \r\n   b) Apply additional PR #17351 if you are using mysql database. \r\n3. Apply this PR\r\n4. Go to backend -> extension -> manage -> database -> and click on fix button. \r\n\r\n### Expected result\r\nAll works as before."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/366433607","html_url":"https://github.com/joomla/joomla-cms/pull/19708#issuecomment-366433607","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/19708","id":366433607,"user":{"login":"alikon","id":181681,"avatar_url":"https://avatars0.githubusercontent.com/u/181681?v=4","gravatar_id":"","url":"https://api.github.com/users/alikon","html_url":"https://github.com/alikon","followers_url":"https://api.github.com/users/alikon/followers","following_url":"https://api.github.com/users/alikon/following{/other_user}","gists_url":"https://api.github.com/users/alikon/gists{/gist_id}","starred_url":"https://api.github.com/users/alikon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alikon/subscriptions","organizations_url":"https://api.github.com/users/alikon/orgs","repos_url":"https://api.github.com/users/alikon/repos","events_url":"https://api.github.com/users/alikon/events{/privacy}","received_events_url":"https://api.github.com/users/alikon/received_events","type":"User","site_admin":false},"created_at":"2018-02-17T10:59:31Z","updated_at":"2018-02-17T10:59:31Z","author_association":"CONTRIBUTOR","body":"we should take care of the update path, of course, but a good move "}}
{"actor":{"display_login":"alikon"}}