{"action":"created","comment":{"url":"https://api.github.com/repos/hyrise/hyrise/pulls/comments/187442908","pull_request_review_id":119226359,"id":187442908,"diff_hunk":"@@ -0,0 +1,67 @@\n+#include \"abstract_cost_feature_proxy.hpp\"\n+\n+#include <cmath>\n+\n+#include \"logical_query_plan/abstract_lqp_node.hpp\"\n+\n+namespace opossum {\n+\n+CostFeatureVariant AbstractCostFeatureProxy::extract_feature(const CostFeature cost_feature) const {\n+  switch (cost_feature) {\n+    case CostFeature::InputRowCountProduct:\n+      return {extract_feature(CostFeature::LeftInputRowCount).scalar() *\n+              extract_feature(CostFeature::RightInputRowCount).scalar()};\n+    case CostFeature::LeftInputReferenceRowCount:\n+      return extract_feature(CostFeature::LeftInputIsReferences).boolean()\n+                 ? extract_feature(CostFeature::LeftInputRowCount).scalar()\n+                 : 0.0f;\n+    case CostFeature::RightInputReferenceRowCount:\n+      return extract_feature(CostFeature::RightInputIsReferences).boolean()\n+                 ? extract_feature(CostFeature::RightInputRowCount).scalar()\n+                 : 0.0f;\n+    case CostFeature::LeftInputRowCountLogN: {\n+      const auto row_count = extract_feature(CostFeature::LeftInputRowCount).scalar();\n+      return row_count * std::log(row_count);\n+    }\n+    case CostFeature::RightInputRowCountLogN: {\n+      const auto row_count = extract_feature(CostFeature::RightInputRowCount).scalar();\n+      return row_count * std::log(row_count);\n+    }\n+    case CostFeature::MajorInputRowCount: {","path":"src/lib/cost_model/abstract_cost_feature_proxy.cpp","position":30,"original_position":30,"commit_id":"319ce8edd7c052e19c81ad21bef8ecc59cfe83c3","original_commit_id":"319ce8edd7c052e19c81ad21bef8ecc59cfe83c3","user":{"login":"mrzzzrm","id":2679018,"avatar_url":"https://avatars3.githubusercontent.com/u/2679018?v=4","gravatar_id":"","url":"https://api.github.com/users/mrzzzrm","html_url":"https://github.com/mrzzzrm","followers_url":"https://api.github.com/users/mrzzzrm/followers","following_url":"https://api.github.com/users/mrzzzrm/following{/other_user}","gists_url":"https://api.github.com/users/mrzzzrm/gists{/gist_id}","starred_url":"https://api.github.com/users/mrzzzrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrzzzrm/subscriptions","organizations_url":"https://api.github.com/users/mrzzzrm/orgs","repos_url":"https://api.github.com/users/mrzzzrm/repos","events_url":"https://api.github.com/users/mrzzzrm/events{/privacy}","received_events_url":"https://api.github.com/users/mrzzzrm/received_events","type":"User","site_admin":false},"body":"Renamed","created_at":"2018-05-10T20:02:10Z","updated_at":"2018-05-10T20:02:11Z","html_url":"https://github.com/hyrise/hyrise/pull/825#discussion_r187442908","pull_request_url":"https://api.github.com/repos/hyrise/hyrise/pulls/825","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hyrise/hyrise/pulls/comments/187442908"},"html":{"href":"https://github.com/hyrise/hyrise/pull/825#discussion_r187442908"},"pull_request":{"href":"https://api.github.com/repos/hyrise/hyrise/pulls/825"}},"in_reply_to_id":186995731},"pull_request":{"url":"https://api.github.com/repos/hyrise/hyrise/pulls/825","id":180989685,"html_url":"https://github.com/hyrise/hyrise/pull/825","diff_url":"https://github.com/hyrise/hyrise/pull/825.diff","patch_url":"https://github.com/hyrise/hyrise/pull/825.patch","issue_url":"https://api.github.com/repos/hyrise/hyrise/issues/825","number":825,"state":"open","locked":false,"title":"Cost Models","user":{"login":"mrzzzrm","id":2679018,"avatar_url":"https://avatars3.githubusercontent.com/u/2679018?v=4","gravatar_id":"","url":"https://api.github.com/users/mrzzzrm","html_url":"https://github.com/mrzzzrm","followers_url":"https://api.github.com/users/mrzzzrm/followers","following_url":"https://api.github.com/users/mrzzzrm/following{/other_user}","gists_url":"https://api.github.com/users/mrzzzrm/gists{/gist_id}","starred_url":"https://api.github.com/users/mrzzzrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrzzzrm/subscriptions","organizations_url":"https://api.github.com/users/mrzzzrm/orgs","repos_url":"https://api.github.com/users/mrzzzrm/repos","events_url":"https://api.github.com/users/mrzzzrm/events{/privacy}","received_events_url":"https://api.github.com/users/mrzzzrm/received_events","type":"User","site_admin":false},"body":"This introduces the notion of a CostModel (see `class AbstractCostModel`) that assigns a \"Cost\" to PQP Operators and LQP Nodes (making assumptions which Operator they will be turned into). The most intuitive notion of what a \"Cost\" is, is runtime - but it could be anything the optimizer should aim to minimize within the query plan.\r\n\r\nIntroduced are two Cost Model: `CostModelNaive` which is precisely what the name suggests but has performed reasonably well in my experiments - and `CostModelLinear` which is an attempt to predict the actual runtime of an operator. The first will be the \"production\" model used in the Optimizer because of its simplicity while I will use the second one for experiments until I can present data that proves it superiority.\r\n","created_at":"2018-04-11T18:27:54Z","updated_at":"2018-05-10T20:02:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a6759c6e73561ad75c35d40a01ac853897d0d9e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/hyrise/hyrise/pulls/825/commits","review_comments_url":"https://api.github.com/repos/hyrise/hyrise/pulls/825/comments","review_comment_url":"https://api.github.com/repos/hyrise/hyrise/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hyrise/hyrise/issues/825/comments","statuses_url":"https://api.github.com/repos/hyrise/hyrise/statuses/319ce8edd7c052e19c81ad21bef8ecc59cfe83c3","head":{"label":"hyrise:feature/cost_models","ref":"feature/cost_models","sha":"319ce8edd7c052e19c81ad21bef8ecc59cfe83c3","user":{"login":"hyrise","id":3465095,"avatar_url":"https://avatars2.githubusercontent.com/u/3465095?v=4","gravatar_id":"","url":"https://api.github.com/users/hyrise","html_url":"https://github.com/hyrise","followers_url":"https://api.github.com/users/hyrise/followers","following_url":"https://api.github.com/users/hyrise/following{/other_user}","gists_url":"https://api.github.com/users/hyrise/gists{/gist_id}","starred_url":"https://api.github.com/users/hyrise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyrise/subscriptions","organizations_url":"https://api.github.com/users/hyrise/orgs","repos_url":"https://api.github.com/users/hyrise/repos","events_url":"https://api.github.com/users/hyrise/events{/privacy}","received_events_url":"https://api.github.com/users/hyrise/received_events","type":"Organization","site_admin":false},"repo":{"id":87414843,"name":"hyrise","full_name":"hyrise/hyrise","owner":{"login":"hyrise","id":3465095,"avatar_url":"https://avatars2.githubusercontent.com/u/3465095?v=4","gravatar_id":"","url":"https://api.github.com/users/hyrise","html_url":"https://github.com/hyrise","followers_url":"https://api.github.com/users/hyrise/followers","following_url":"https://api.github.com/users/hyrise/following{/other_user}","gists_url":"https://api.github.com/users/hyrise/gists{/gist_id}","starred_url":"https://api.github.com/users/hyrise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyrise/subscriptions","organizations_url":"https://api.github.com/users/hyrise/orgs","repos_url":"https://api.github.com/users/hyrise/repos","events_url":"https://api.github.com/users/hyrise/events{/privacy}","received_events_url":"https://api.github.com/users/hyrise/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyrise/hyrise","description":"A research in-memory database.","fork":false,"url":"https://api.github.com/repos/hyrise/hyrise","forks_url":"https://api.github.com/repos/hyrise/hyrise/forks","keys_url":"https://api.github.com/repos/hyrise/hyrise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyrise/hyrise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyrise/hyrise/teams","hooks_url":"https://api.github.com/repos/hyrise/hyrise/hooks","issue_events_url":"https://api.github.com/repos/hyrise/hyrise/issues/events{/number}","events_url":"https://api.github.com/repos/hyrise/hyrise/events","assignees_url":"https://api.github.com/repos/hyrise/hyrise/assignees{/user}","branches_url":"https://api.github.com/repos/hyrise/hyrise/branches{/branch}","tags_url":"https://api.github.com/repos/hyrise/hyrise/tags","blobs_url":"https://api.github.com/repos/hyrise/hyrise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyrise/hyrise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyrise/hyrise/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyrise/hyrise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyrise/hyrise/statuses/{sha}","languages_url":"https://api.github.com/repos/hyrise/hyrise/languages","stargazers_url":"https://api.github.com/repos/hyrise/hyrise/stargazers","contributors_url":"https://api.github.com/repos/hyrise/hyrise/contributors","subscribers_url":"https://api.github.com/repos/hyrise/hyrise/subscribers","subscription_url":"https://api.github.com/repos/hyrise/hyrise/subscription","commits_url":"https://api.github.com/repos/hyrise/hyrise/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyrise/hyrise/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyrise/hyrise/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyrise/hyrise/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyrise/hyrise/contents/{+path}","compare_url":"https://api.github.com/repos/hyrise/hyrise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyrise/hyrise/merges","archive_url":"https://api.github.com/repos/hyrise/hyrise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyrise/hyrise/downloads","issues_url":"https://api.github.com/repos/hyrise/hyrise/issues{/number}","pulls_url":"https://api.github.com/repos/hyrise/hyrise/pulls{/number}","milestones_url":"https://api.github.com/repos/hyrise/hyrise/milestones{/number}","notifications_url":"https://api.github.com/repos/hyrise/hyrise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyrise/hyrise/labels{/name}","releases_url":"https://api.github.com/repos/hyrise/hyrise/releases{/id}","deployments_url":"https://api.github.com/repos/hyrise/hyrise/deployments","created_at":"2017-04-06T10:03:31Z","updated_at":"2018-05-10T08:29:20Z","pushed_at":"2018-05-10T15:53:16Z","git_url":"git://github.com/hyrise/hyrise.git","ssh_url":"git@github.com:hyrise/hyrise.git","clone_url":"https://github.com/hyrise/hyrise.git","svn_url":"https://github.com/hyrise/hyrise","homepage":"https://hpi.de/plattner/projects/hyrise.html","size":11329,"stargazers_count":66,"watchers_count":66,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":77,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":22,"open_issues":77,"watchers":66,"default_branch":"master"}},"base":{"label":"hyrise:master","ref":"master","sha":"f76bc39ac5dc0ac804da8cb8f7ba15246abed89c","user":{"login":"hyrise","id":3465095,"avatar_url":"https://avatars2.githubusercontent.com/u/3465095?v=4","gravatar_id":"","url":"https://api.github.com/users/hyrise","html_url":"https://github.com/hyrise","followers_url":"https://api.github.com/users/hyrise/followers","following_url":"https://api.github.com/users/hyrise/following{/other_user}","gists_url":"https://api.github.com/users/hyrise/gists{/gist_id}","starred_url":"https://api.github.com/users/hyrise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyrise/subscriptions","organizations_url":"https://api.github.com/users/hyrise/orgs","repos_url":"https://api.github.com/users/hyrise/repos","events_url":"https://api.github.com/users/hyrise/events{/privacy}","received_events_url":"https://api.github.com/users/hyrise/received_events","type":"Organization","site_admin":false},"repo":{"id":87414843,"name":"hyrise","full_name":"hyrise/hyrise","owner":{"login":"hyrise","id":3465095,"avatar_url":"https://avatars2.githubusercontent.com/u/3465095?v=4","gravatar_id":"","url":"https://api.github.com/users/hyrise","html_url":"https://github.com/hyrise","followers_url":"https://api.github.com/users/hyrise/followers","following_url":"https://api.github.com/users/hyrise/following{/other_user}","gists_url":"https://api.github.com/users/hyrise/gists{/gist_id}","starred_url":"https://api.github.com/users/hyrise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyrise/subscriptions","organizations_url":"https://api.github.com/users/hyrise/orgs","repos_url":"https://api.github.com/users/hyrise/repos","events_url":"https://api.github.com/users/hyrise/events{/privacy}","received_events_url":"https://api.github.com/users/hyrise/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hyrise/hyrise","description":"A research in-memory database.","fork":false,"url":"https://api.github.com/repos/hyrise/hyrise","forks_url":"https://api.github.com/repos/hyrise/hyrise/forks","keys_url":"https://api.github.com/repos/hyrise/hyrise/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hyrise/hyrise/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hyrise/hyrise/teams","hooks_url":"https://api.github.com/repos/hyrise/hyrise/hooks","issue_events_url":"https://api.github.com/repos/hyrise/hyrise/issues/events{/number}","events_url":"https://api.github.com/repos/hyrise/hyrise/events","assignees_url":"https://api.github.com/repos/hyrise/hyrise/assignees{/user}","branches_url":"https://api.github.com/repos/hyrise/hyrise/branches{/branch}","tags_url":"https://api.github.com/repos/hyrise/hyrise/tags","blobs_url":"https://api.github.com/repos/hyrise/hyrise/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hyrise/hyrise/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hyrise/hyrise/git/refs{/sha}","trees_url":"https://api.github.com/repos/hyrise/hyrise/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hyrise/hyrise/statuses/{sha}","languages_url":"https://api.github.com/repos/hyrise/hyrise/languages","stargazers_url":"https://api.github.com/repos/hyrise/hyrise/stargazers","contributors_url":"https://api.github.com/repos/hyrise/hyrise/contributors","subscribers_url":"https://api.github.com/repos/hyrise/hyrise/subscribers","subscription_url":"https://api.github.com/repos/hyrise/hyrise/subscription","commits_url":"https://api.github.com/repos/hyrise/hyrise/commits{/sha}","git_commits_url":"https://api.github.com/repos/hyrise/hyrise/git/commits{/sha}","comments_url":"https://api.github.com/repos/hyrise/hyrise/comments{/number}","issue_comment_url":"https://api.github.com/repos/hyrise/hyrise/issues/comments{/number}","contents_url":"https://api.github.com/repos/hyrise/hyrise/contents/{+path}","compare_url":"https://api.github.com/repos/hyrise/hyrise/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hyrise/hyrise/merges","archive_url":"https://api.github.com/repos/hyrise/hyrise/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hyrise/hyrise/downloads","issues_url":"https://api.github.com/repos/hyrise/hyrise/issues{/number}","pulls_url":"https://api.github.com/repos/hyrise/hyrise/pulls{/number}","milestones_url":"https://api.github.com/repos/hyrise/hyrise/milestones{/number}","notifications_url":"https://api.github.com/repos/hyrise/hyrise/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hyrise/hyrise/labels{/name}","releases_url":"https://api.github.com/repos/hyrise/hyrise/releases{/id}","deployments_url":"https://api.github.com/repos/hyrise/hyrise/deployments","created_at":"2017-04-06T10:03:31Z","updated_at":"2018-05-10T08:29:20Z","pushed_at":"2018-05-10T15:53:16Z","git_url":"git://github.com/hyrise/hyrise.git","ssh_url":"git@github.com:hyrise/hyrise.git","clone_url":"https://github.com/hyrise/hyrise.git","svn_url":"https://github.com/hyrise/hyrise","homepage":"https://hpi.de/plattner/projects/hyrise.html","size":11329,"stargazers_count":66,"watchers_count":66,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"archived":false,"open_issues_count":77,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":22,"open_issues":77,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hyrise/hyrise/pulls/825"},"html":{"href":"https://github.com/hyrise/hyrise/pull/825"},"issue":{"href":"https://api.github.com/repos/hyrise/hyrise/issues/825"},"comments":{"href":"https://api.github.com/repos/hyrise/hyrise/issues/825/comments"},"review_comments":{"href":"https://api.github.com/repos/hyrise/hyrise/pulls/825/comments"},"review_comment":{"href":"https://api.github.com/repos/hyrise/hyrise/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hyrise/hyrise/pulls/825/commits"},"statuses":{"href":"https://api.github.com/repos/hyrise/hyrise/statuses/319ce8edd7c052e19c81ad21bef8ecc59cfe83c3"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mrzzzrm"}}