{"action":"created","issue":{"url":"https://api.github.com/repos/dalibo/powa/issues/68","repository_url":"https://api.github.com/repos/dalibo/powa","labels_url":"https://api.github.com/repos/dalibo/powa/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/dalibo/powa/issues/68/comments","events_url":"https://api.github.com/repos/dalibo/powa/issues/68/events","html_url":"https://github.com/dalibo/powa/issues/68","id":131084485,"number":68,"title":"Slow Performance for Busy Database","user":{"login":"mikealbert","id":355817,"avatar_url":"https://avatars.githubusercontent.com/u/355817?v=3","gravatar_id":"","url":"https://api.github.com/users/mikealbert","html_url":"https://github.com/mikealbert","followers_url":"https://api.github.com/users/mikealbert/followers","following_url":"https://api.github.com/users/mikealbert/following{/other_user}","gists_url":"https://api.github.com/users/mikealbert/gists{/gist_id}","starred_url":"https://api.github.com/users/mikealbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikealbert/subscriptions","organizations_url":"https://api.github.com/users/mikealbert/orgs","repos_url":"https://api.github.com/users/mikealbert/repos","events_url":"https://api.github.com/users/mikealbert/events{/privacy}","received_events_url":"https://api.github.com/users/mikealbert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-03T16:49:53Z","updated_at":"2016-02-13T18:31:52Z","closed_at":null,"body":"Hi,\r\n\r\nThanks for the great tool.  We've recently deployed it to our Production environment and it has definitely helped us prioritize sql statements for tuning.\r\n\r\nWe've noticed that with one of our larger (20GB) and most active databases, performance of the POWA app suffers.  In particular, the \"Details for all queries\" widget takes a very long time to display after an adjustment is made to the timeframe in the top right corner.  In some cases it can take a couple minutes or longer for that data to display.\r\n\r\nLet me know what other details I can provide to help troubleshoot.  This only seems to be a problem with our most busiest database.  We've had POWA deployed for only 5 days and the POWA database is 400MB.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/dalibo/powa/issues/comments/183718852","html_url":"https://github.com/dalibo/powa/issues/68#issuecomment-183718852","issue_url":"https://api.github.com/repos/dalibo/powa/issues/68","id":183718852,"user":{"login":"rjuju","id":1608890,"avatar_url":"https://avatars.githubusercontent.com/u/1608890?v=3","gravatar_id":"","url":"https://api.github.com/users/rjuju","html_url":"https://github.com/rjuju","followers_url":"https://api.github.com/users/rjuju/followers","following_url":"https://api.github.com/users/rjuju/following{/other_user}","gists_url":"https://api.github.com/users/rjuju/gists{/gist_id}","starred_url":"https://api.github.com/users/rjuju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjuju/subscriptions","organizations_url":"https://api.github.com/users/rjuju/orgs","repos_url":"https://api.github.com/users/rjuju/repos","events_url":"https://api.github.com/users/rjuju/events{/privacy}","received_events_url":"https://api.github.com/users/rjuju/received_events","type":"User","site_admin":false},"created_at":"2016-02-13T18:31:52Z","updated_at":"2016-02-13T18:31:52Z","body":"Sorry for late answer.\r\n\r\nYes, the \"?\" are hardcoded values (normalized by pg_stat_statements), and the $x are the parameters of prepared queries.\r\n\r\nSo it seems that the root cause of slowness is the large amount of distinct normalized queries, caused by using \"IN (...)\" with different number of values. Unfortunately, this is an issue in pg_stat_statements, so there's nothing we can do for it in powa, except ignoring these statements :(\r\n\r\nFTR, this has already been discussed on -hackers ML, see http://www.postgresql.org/message-id/CAM3SWZSpdPB3uErnXWMt3q74y0r+84ZsOt2U3HKKes_V7O+0Qg@mail.gmail.com (this is also an open TODO item)."}}