{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq-schema/issues/48","repository_url":"https://api.github.com/repos/ManageIQ/manageiq-schema","labels_url":"https://api.github.com/repos/ManageIQ/manageiq-schema/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq-schema/issues/48/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq-schema/issues/48/events","html_url":"https://github.com/ManageIQ/manageiq-schema/pull/48","id":249139703,"number":48,"title":"single sequence for all metrics sub tables","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars2.githubusercontent.com/u/1930?v=4","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"labels":[{"id":630622103,"url":"https://api.github.com/repos/ManageIQ/manageiq-schema/labels/performance","name":"performance","color":"e99695","default":false},{"id":654725933,"url":"https://api.github.com/repos/ManageIQ/manageiq-schema/labels/schema","name":"schema","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars3.githubusercontent.com/u/52120?v=4","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"assignees":[{"login":"Fryguy","id":52120,"avatar_url":"https://avatars3.githubusercontent.com/u/52120?v=4","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-08-09T19:42:09Z","updated_at":"2017-10-06T20:24:33Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq-schema/pulls/48","html_url":"https://github.com/ManageIQ/manageiq-schema/pull/48","diff_url":"https://github.com/ManageIQ/manageiq-schema/pull/48.diff","patch_url":"https://github.com/ManageIQ/manageiq-schema/pull/48.patch"},"body":"**Before:**\r\nEvery `metrics_**` table had a different sequence.\r\nSo inserting directly into a subtable would result in overlapping `id` values.\r\nWe currently insert into the base `metrics` table, so this is not a problem.\r\n\r\n```\r\n Column |  Type  |                           Modifiers                            \r\n--------+--------+---------------------------------------------------------------\r\n id     | bigint | not null default nextval('metric_rollups_01_id_seq'::regclass)\r\n```\r\n\r\n**After:**\r\nEvery`metrics` subtable uses the same sequence.\r\nSo inserting into any of the metrics tables will get a unique id.\r\n\r\n```\r\n Column |  Type  |                           Modifiers                            \r\n--------+--------+---------------------------------------------------------------\r\n id     | bigint | not null default nextval('metric_rollups_id_seq'::regclass)\r\n```\r\n\r\nRollback does bring back to the previous value\r\n\r\n```\r\n Column |  Type  |                           Modifiers                            \r\n--------+--------+---------------------------------------------------------------\r\n id     | bigint | not null default nextval('metric_rollups_01_id_seq'::regclass)\r\n```\r\n\r\n\r\nThis change allows us to insert directly into the subtable, which is 10x faster than inserting into the common parent table.\r\n\r\n/cc @chrisarcand @Fryguy "},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq-schema/issues/comments/334860939","html_url":"https://github.com/ManageIQ/manageiq-schema/pull/48#issuecomment-334860939","issue_url":"https://api.github.com/repos/ManageIQ/manageiq-schema/issues/48","id":334860939,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars1.githubusercontent.com/u/7806257?v=4","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2017-10-06T20:24:33Z","updated_at":"2017-10-06T20:24:33Z","author_association":"MEMBER","body":"<rubocop />Checked commit https://github.com/kbrock/manageiq-schema/commit/af5d6e1938ff91666b6b8d13542999d25ac8777b with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0\n1 file checked, 0 offenses detected\nEverything looks fine. :cookie:\n"}}
{"actor":{"display_login":"miq-bot"}}