{"action":"created","comment":{"url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/comments/31803494","id":31803494,"diff_hunk":"@@ -204,6 +207,30 @@ def process_response(self, request, response):\n             if trans_id:\n                 self._queries[(i - 1)][1]['ends_trans'] = True\n \n+        # Queries are duplicates only if there's as least 2 of them.\n+        # Also, to hide queries, we need to give all the duplicate groups an id\n+        query_duplicates = {\n+            alias: {\n+                query: duplicate_count\n+                for query, duplicate_count in queries.items()\n+                if duplicate_count >= 2\n+            }\n+            for alias, queries in query_duplicates.items()\n+        }","path":"debug_toolbar/panels/sql/panel.py","position":30,"original_position":30,"commit_id":"734f4834057e136e6c1aa1bdf68fb753d6fb3c74","original_commit_id":"734f4834057e136e6c1aa1bdf68fb753d6fb3c74","user":{"login":"aaugustin","id":788910,"avatar_url":"https://avatars.githubusercontent.com/u/788910?v=3","gravatar_id":"","url":"https://api.github.com/users/aaugustin","html_url":"https://github.com/aaugustin","followers_url":"https://api.github.com/users/aaugustin/followers","following_url":"https://api.github.com/users/aaugustin/following{/other_user}","gists_url":"https://api.github.com/users/aaugustin/gists{/gist_id}","starred_url":"https://api.github.com/users/aaugustin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaugustin/subscriptions","organizations_url":"https://api.github.com/users/aaugustin/orgs","repos_url":"https://api.github.com/users/aaugustin/repos","events_url":"https://api.github.com/users/aaugustin/events{/privacy}","received_events_url":"https://api.github.com/users/aaugustin/received_events","type":"User","site_admin":false},"body":"Until now we haven't used dict comprehensions because we're supporting Django 1.4 and Python 2.5. 1.4 is still supported until October 1st.","created_at":"2015-06-05T10:50:39Z","updated_at":"2015-06-05T10:50:39Z","html_url":"https://github.com/django-debug-toolbar/django-debug-toolbar/pull/719#discussion_r31803494","pull_request_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719","_links":{"self":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/comments/31803494"},"html":{"href":"https://github.com/django-debug-toolbar/django-debug-toolbar/pull/719#discussion_r31803494"},"pull_request":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719"}}},"pull_request":{"url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719","id":37012030,"html_url":"https://github.com/django-debug-toolbar/django-debug-toolbar/pull/719","diff_url":"https://github.com/django-debug-toolbar/django-debug-toolbar/pull/719.diff","patch_url":"https://github.com/django-debug-toolbar/django-debug-toolbar/pull/719.patch","issue_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues/719","number":719,"state":"open","locked":false,"title":"Display the count of SQL duplicates (fixes #27)","user":{"login":"ewjoachim","id":1457576,"avatar_url":"https://avatars.githubusercontent.com/u/1457576?v=3","gravatar_id":"","url":"https://api.github.com/users/ewjoachim","html_url":"https://github.com/ewjoachim","followers_url":"https://api.github.com/users/ewjoachim/followers","following_url":"https://api.github.com/users/ewjoachim/following{/other_user}","gists_url":"https://api.github.com/users/ewjoachim/gists{/gist_id}","starred_url":"https://api.github.com/users/ewjoachim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewjoachim/subscriptions","organizations_url":"https://api.github.com/users/ewjoachim/orgs","repos_url":"https://api.github.com/users/ewjoachim/repos","events_url":"https://api.github.com/users/ewjoachim/events{/privacy}","received_events_url":"https://api.github.com/users/ewjoachim/received_events","type":"User","site_admin":false},"body":"This if my most successful approach at fixing #27\r\n\r\nIf we stick to just displaying the number of duplicates for each database connection and each query, we get some information, and it will help debugging.\r\n\r\nI've been trying to push it a bit further and trying to display only the unique queries at first, with a simple way of showing everything and clear way to understand the groups but I couldn't get something easily understandable without changing the whole UI (which may be interesting, but is definitely out of the scope of this ticket).\r\n\r\nThat being said, I have some ideas and I'll try to implement something at some point.","created_at":"2015-06-05T08:51:29Z","updated_at":"2015-06-05T10:50:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b333cf35e803f94beaa77ef310cb59a7165952e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719/commits","review_comments_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719/comments","review_comment_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues/719/comments","statuses_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/statuses/734f4834057e136e6c1aa1bdf68fb753d6fb3c74","head":{"label":"ewjoachim:duplicate_sql","ref":"duplicate_sql","sha":"734f4834057e136e6c1aa1bdf68fb753d6fb3c74","user":{"login":"ewjoachim","id":1457576,"avatar_url":"https://avatars.githubusercontent.com/u/1457576?v=3","gravatar_id":"","url":"https://api.github.com/users/ewjoachim","html_url":"https://github.com/ewjoachim","followers_url":"https://api.github.com/users/ewjoachim/followers","following_url":"https://api.github.com/users/ewjoachim/following{/other_user}","gists_url":"https://api.github.com/users/ewjoachim/gists{/gist_id}","starred_url":"https://api.github.com/users/ewjoachim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewjoachim/subscriptions","organizations_url":"https://api.github.com/users/ewjoachim/orgs","repos_url":"https://api.github.com/users/ewjoachim/repos","events_url":"https://api.github.com/users/ewjoachim/events{/privacy}","received_events_url":"https://api.github.com/users/ewjoachim/received_events","type":"User","site_admin":false},"repo":{"id":36864340,"name":"django-debug-toolbar","full_name":"ewjoachim/django-debug-toolbar","owner":{"login":"ewjoachim","id":1457576,"avatar_url":"https://avatars.githubusercontent.com/u/1457576?v=3","gravatar_id":"","url":"https://api.github.com/users/ewjoachim","html_url":"https://github.com/ewjoachim","followers_url":"https://api.github.com/users/ewjoachim/followers","following_url":"https://api.github.com/users/ewjoachim/following{/other_user}","gists_url":"https://api.github.com/users/ewjoachim/gists{/gist_id}","starred_url":"https://api.github.com/users/ewjoachim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewjoachim/subscriptions","organizations_url":"https://api.github.com/users/ewjoachim/orgs","repos_url":"https://api.github.com/users/ewjoachim/repos","events_url":"https://api.github.com/users/ewjoachim/events{/privacy}","received_events_url":"https://api.github.com/users/ewjoachim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ewjoachim/django-debug-toolbar","description":"A configurable set of panels that display various debug information about the current request/response.","fork":true,"url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar","forks_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/forks","keys_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/teams","hooks_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/hooks","issue_events_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/issues/events{/number}","events_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/events","assignees_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/assignees{/user}","branches_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/branches{/branch}","tags_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/tags","blobs_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/git/refs{/sha}","trees_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/statuses/{sha}","languages_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/languages","stargazers_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/stargazers","contributors_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/contributors","subscribers_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/subscribers","subscription_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/subscription","commits_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/commits{/sha}","git_commits_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/git/commits{/sha}","comments_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/comments{/number}","issue_comment_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/issues/comments{/number}","contents_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/contents/{+path}","compare_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/merges","archive_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/downloads","issues_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/issues{/number}","pulls_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/pulls{/number}","milestones_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/milestones{/number}","notifications_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/labels{/name}","releases_url":"https://api.github.com/repos/ewjoachim/django-debug-toolbar/releases{/id}","created_at":"2015-06-04T10:39:32Z","updated_at":"2015-06-04T10:39:33Z","pushed_at":"2015-06-05T08:43:12Z","git_url":"git://github.com/ewjoachim/django-debug-toolbar.git","ssh_url":"git@github.com:ewjoachim/django-debug-toolbar.git","clone_url":"https://github.com/ewjoachim/django-debug-toolbar.git","svn_url":"https://github.com/ewjoachim/django-debug-toolbar","homepage":"http://django-debug-toolbar.readthedocs.org/","size":7705,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django-debug-toolbar:master","ref":"master","sha":"39b4231637bb9be1c0e3cfc122a0b428ed422c31","user":{"login":"django-debug-toolbar","id":759502,"avatar_url":"https://avatars.githubusercontent.com/u/759502?v=3","gravatar_id":"","url":"https://api.github.com/users/django-debug-toolbar","html_url":"https://github.com/django-debug-toolbar","followers_url":"https://api.github.com/users/django-debug-toolbar/followers","following_url":"https://api.github.com/users/django-debug-toolbar/following{/other_user}","gists_url":"https://api.github.com/users/django-debug-toolbar/gists{/gist_id}","starred_url":"https://api.github.com/users/django-debug-toolbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-debug-toolbar/subscriptions","organizations_url":"https://api.github.com/users/django-debug-toolbar/orgs","repos_url":"https://api.github.com/users/django-debug-toolbar/repos","events_url":"https://api.github.com/users/django-debug-toolbar/events{/privacy}","received_events_url":"https://api.github.com/users/django-debug-toolbar/received_events","type":"Organization","site_admin":false},"repo":{"id":46939,"name":"django-debug-toolbar","full_name":"django-debug-toolbar/django-debug-toolbar","owner":{"login":"django-debug-toolbar","id":759502,"avatar_url":"https://avatars.githubusercontent.com/u/759502?v=3","gravatar_id":"","url":"https://api.github.com/users/django-debug-toolbar","html_url":"https://github.com/django-debug-toolbar","followers_url":"https://api.github.com/users/django-debug-toolbar/followers","following_url":"https://api.github.com/users/django-debug-toolbar/following{/other_user}","gists_url":"https://api.github.com/users/django-debug-toolbar/gists{/gist_id}","starred_url":"https://api.github.com/users/django-debug-toolbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django-debug-toolbar/subscriptions","organizations_url":"https://api.github.com/users/django-debug-toolbar/orgs","repos_url":"https://api.github.com/users/django-debug-toolbar/repos","events_url":"https://api.github.com/users/django-debug-toolbar/events{/privacy}","received_events_url":"https://api.github.com/users/django-debug-toolbar/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django-debug-toolbar/django-debug-toolbar","description":"A configurable set of panels that display various debug information about the current request/response.","fork":false,"url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar","forks_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/forks","keys_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/teams","hooks_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/hooks","issue_events_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues/events{/number}","events_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/events","assignees_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/assignees{/user}","branches_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/branches{/branch}","tags_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/tags","blobs_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/git/refs{/sha}","trees_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/statuses/{sha}","languages_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/languages","stargazers_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/stargazers","contributors_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/contributors","subscribers_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/subscribers","subscription_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/subscription","commits_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/commits{/sha}","git_commits_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/git/commits{/sha}","comments_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/comments{/number}","issue_comment_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues/comments{/number}","contents_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/contents/{+path}","compare_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/merges","archive_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/downloads","issues_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues{/number}","pulls_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls{/number}","milestones_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/milestones{/number}","notifications_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/labels{/name}","releases_url":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/releases{/id}","created_at":"2008-08-28T06:58:04Z","updated_at":"2015-06-05T05:08:59Z","pushed_at":"2015-06-05T08:51:29Z","git_url":"git://github.com/django-debug-toolbar/django-debug-toolbar.git","ssh_url":"git@github.com:django-debug-toolbar/django-debug-toolbar.git","clone_url":"https://github.com/django-debug-toolbar/django-debug-toolbar.git","svn_url":"https://github.com/django-debug-toolbar/django-debug-toolbar","homepage":"http://django-debug-toolbar.readthedocs.org/","size":7705,"stargazers_count":3134,"watchers_count":3134,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":608,"mirror_url":null,"open_issues_count":28,"forks":608,"open_issues":28,"watchers":3134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719"},"html":{"href":"https://github.com/django-debug-toolbar/django-debug-toolbar/pull/719"},"issue":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues/719"},"comments":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/issues/719/comments"},"review_comments":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719/comments"},"review_comment":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/pulls/719/commits"},"statuses":{"href":"https://api.github.com/repos/django-debug-toolbar/django-debug-toolbar/statuses/734f4834057e136e6c1aa1bdf68fb753d6fb3c74"}}}}