{"action":"created","comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/87301334","pull_request_review_id":7919588,"id":87301334,"diff_hunk":"@@ -0,0 +1,122 @@\n+/* This file is part of VoltDB.\n+ * Copyright (C) 2008-2016 VoltDB Inc.\n+ *\n+ * This program is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Affero General Public License as\n+ * published by the Free Software Foundation, either version 3 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Affero General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Affero General Public License\n+ * along with VoltDB.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+\n+package org.voltdb.compilereport;\n+\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import org.voltdb.catalog.CatalogMap;\n+import org.voltdb.catalog.Column;\n+import org.voltdb.catalog.IndexRef;\n+import org.voltdb.catalog.MaterializedViewHandlerInfo;\n+import org.voltdb.catalog.MaterializedViewInfo;\n+import org.voltdb.catalog.Statement;\n+import org.voltdb.catalog.Table;\n+import org.voltdb.types.ExpressionType;\n+import org.voltdb.utils.CatalogUtil;\n+import org.voltdb.utils.Encoder;\n+\n+// Generate a report that can explain to the users how we maintain a view.\n+public class ViewExplainer {\n+\n+    private static String getIndexNameUsedInStatement(Statement stmt) {\n+        // We should get at most one index from the statement.","path":"src/frontend/org/voltdb/compilereport/ViewExplainer.java","position":38,"original_position":38,"commit_id":"b515f598d4f5b23bba6cfe6237fed095014582c0","original_commit_id":"b515f598d4f5b23bba6cfe6237fed095014582c0","user":{"login":"yzhang1991","id":6643318,"avatar_url":"https://avatars.githubusercontent.com/u/6643318?v=3","gravatar_id":"","url":"https://api.github.com/users/yzhang1991","html_url":"https://github.com/yzhang1991","followers_url":"https://api.github.com/users/yzhang1991/followers","following_url":"https://api.github.com/users/yzhang1991/following{/other_user}","gists_url":"https://api.github.com/users/yzhang1991/gists{/gist_id}","starred_url":"https://api.github.com/users/yzhang1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yzhang1991/subscriptions","organizations_url":"https://api.github.com/users/yzhang1991/orgs","repos_url":"https://api.github.com/users/yzhang1991/repos","events_url":"https://api.github.com/users/yzhang1991/events{/privacy}","received_events_url":"https://api.github.com/users/yzhang1991/received_events","type":"User","site_admin":false},"body":"This `getIndexNameUsedInStatement()` function is only used to extract the name of the index that was used in a statement in single-table view cases. For views with joins, we always directly output the plan explanation text.\r\nThe queries we used to refresh a MIN/MAX column in single-table view cases are always like this:\r\n```sql\r\nSELECT MIN(col) FROM T WHERE g1 = ? AND g2 = ? AND col >= ?;\r\n```\r\nI cannot think of a case where such queries can reference more than one index for evaluation. Do you think I missed anything?","created_at":"2016-11-09T23:35:06Z","updated_at":"2016-11-09T23:35:06Z","html_url":"https://github.com/VoltDB/voltdb/pull/4048#discussion_r87301334","pull_request_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048","_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/87301334"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/4048#discussion_r87301334"},"pull_request":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048"}}},"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048","id":92875645,"html_url":"https://github.com/VoltDB/voltdb/pull/4048","diff_url":"https://github.com/VoltDB/voltdb/pull/4048.diff","patch_url":"https://github.com/VoltDB/voltdb/pull/4048.patch","issue_url":"https://api.github.com/repos/VoltDB/voltdb/issues/4048","number":4048,"state":"open","locked":false,"title":"ENG-11149 explainview vmc","user":{"login":"yzhang1991","id":6643318,"avatar_url":"https://avatars.githubusercontent.com/u/6643318?v=3","gravatar_id":"","url":"https://api.github.com/users/yzhang1991","html_url":"https://github.com/yzhang1991","followers_url":"https://api.github.com/users/yzhang1991/followers","following_url":"https://api.github.com/users/yzhang1991/following{/other_user}","gists_url":"https://api.github.com/users/yzhang1991/gists{/gist_id}","starred_url":"https://api.github.com/users/yzhang1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yzhang1991/subscriptions","organizations_url":"https://api.github.com/users/yzhang1991/orgs","repos_url":"https://api.github.com/users/yzhang1991/repos","events_url":"https://api.github.com/users/yzhang1991/events{/privacy}","received_events_url":"https://api.github.com/users/yzhang1991/received_events","type":"User","site_admin":false},"body":"This pull request addressed the following issues:\r\n* Integrated Andrew's comments about the presentation of the table.\r\n* Refactored the code for generating the `ExplainView` table. A new class `ViewExplainer` was created so that both `ReportMaker` and `ExplainView` system procedure and share the same code for table generation.\r\n* Added a ReportMaker test case to verify the HTML table generated in VMC is correct.","created_at":"2016-11-08T22:51:30Z","updated_at":"2016-11-09T23:35:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"748b517e2f22c72620dce7b0ced97f426f1e328a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048/commits","review_comments_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048/comments","review_comment_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/issues/4048/comments","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/b515f598d4f5b23bba6cfe6237fed095014582c0","head":{"label":"VoltDB:ENG-11149-explainview-vmc","ref":"ENG-11149-explainview-vmc","sha":"b515f598d4f5b23bba6cfe6237fed095014582c0","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb/deployments","created_at":"2011-09-23T18:46:12Z","updated_at":"2016-11-09T07:30:13Z","pushed_at":"2016-11-09T22:20:34Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":625690,"stargazers_count":886,"watchers_count":886,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":64,"forks":276,"open_issues":64,"watchers":886,"default_branch":"master"}},"base":{"label":"VoltDB:master","ref":"master","sha":"24877858ea2d9031fe931ab4e067c681a719d004","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","deployments_url":"https://api.github.com/repos/VoltDB/voltdb/deployments","created_at":"2011-09-23T18:46:12Z","updated_at":"2016-11-09T07:30:13Z","pushed_at":"2016-11-09T22:20:34Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":625690,"stargazers_count":886,"watchers_count":886,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":64,"forks":276,"open_issues":64,"watchers":886,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/4048"},"issue":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/4048"},"comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/4048/comments"},"review_comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048/comments"},"review_comment":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/4048/commits"},"statuses":{"href":"https://api.github.com/repos/VoltDB/voltdb/statuses/b515f598d4f5b23bba6cfe6237fed095014582c0"}}}}
{"actor":{"display_login":"yzhang1991"}}