{"action":"created","issue":{"url":"https://api.github.com/repos/metabase/metabase/issues/3631","repository_url":"https://api.github.com/repos/metabase/metabase","labels_url":"https://api.github.com/repos/metabase/metabase/issues/3631/labels{/name}","comments_url":"https://api.github.com/repos/metabase/metabase/issues/3631/comments","events_url":"https://api.github.com/repos/metabase/metabase/issues/3631/events","html_url":"https://github.com/metabase/metabase/pull/3631","id":183877561,"number":3631,"title":"Cached result [WIP]","user":{"login":"felipegasparini","id":2293568,"avatar_url":"https://avatars.githubusercontent.com/u/2293568?v=3","gravatar_id":"","url":"https://api.github.com/users/felipegasparini","html_url":"https://github.com/felipegasparini","followers_url":"https://api.github.com/users/felipegasparini/followers","following_url":"https://api.github.com/users/felipegasparini/following{/other_user}","gists_url":"https://api.github.com/users/felipegasparini/gists{/gist_id}","starred_url":"https://api.github.com/users/felipegasparini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipegasparini/subscriptions","organizations_url":"https://api.github.com/users/felipegasparini/orgs","repos_url":"https://api.github.com/users/felipegasparini/repos","events_url":"https://api.github.com/users/felipegasparini/events{/privacy}","received_events_url":"https://api.github.com/users/felipegasparini/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":22,"created_at":"2016-10-19T06:38:42Z","updated_at":"2016-11-03T22:02:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/metabase/metabase/pulls/3631","html_url":"https://github.com/metabase/metabase/pull/3631","diff_url":"https://github.com/metabase/metabase/pull/3631.diff","patch_url":"https://github.com/metabase/metabase/pull/3631.patch"},"body":"**DO NOT MERGE**\n\nJust a initial PR to collect some feedback.\n\nDiscussions in: https://github.com/metabase/metabase/issues/1666\n###### TODO\n- [x] CardCache model and helper functions\n- [x] Refactor (query-processor/dataset-query) to fetch results from cache\n- [x] UI to mark if card should be cached and to specify its cache max-age value - **still need improvements**\n- [ ] UI to bypass (or refresh) the cache in the card page (should we do it?)\n- [ ] UI to bypass (or refresh) the caches of all cards in the dashboard (should we do it?)\n- [ ] Show information about cache state for cards in dashboard and in question \n- [x] Fix cache queries to work in all supported databases (date arithmetic is a PITA across dbs!)\n- [ ] Admin settings to configure cache (global and per card)\n- [ ] Refactor UI to respect cache settings\n- [ ] Refactor backend to respect cache settings\n- [x] Job to delete all expired cache entries (should be scheduled to run every few minutes/hours)\n- [ ] Don't cache results bigger than X bytes (and make X be a property)\n- [ ] Fix broken tests\n- [ ] Add tests to stress cache features\n- [x] Sign the Contributor License Agreement\n- [x] Store cache value in database as blob instead of clob (liquibase when configured to create a column of type blob, creates a column of type oid in Postgres - it is \"okay\" since this is the right way to store large objects, but it should be better to use bytea. Oid comes with the trouble that it should be manually deleted otherwise it will not free the disk space even if the row is deleted)\n- [x] Gzip cache value (or use a better serialization and compression method - messagepack? using nippy library with snappy compression)\n"},"comment":{"url":"https://api.github.com/repos/metabase/metabase/issues/comments/258287727","html_url":"https://github.com/metabase/metabase/pull/3631#issuecomment-258287727","issue_url":"https://api.github.com/repos/metabase/metabase/issues/3631","id":258287727,"user":{"login":"felipegasparini","id":2293568,"avatar_url":"https://avatars.githubusercontent.com/u/2293568?v=3","gravatar_id":"","url":"https://api.github.com/users/felipegasparini","html_url":"https://github.com/felipegasparini","followers_url":"https://api.github.com/users/felipegasparini/followers","following_url":"https://api.github.com/users/felipegasparini/following{/other_user}","gists_url":"https://api.github.com/users/felipegasparini/gists{/gist_id}","starred_url":"https://api.github.com/users/felipegasparini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipegasparini/subscriptions","organizations_url":"https://api.github.com/users/felipegasparini/orgs","repos_url":"https://api.github.com/users/felipegasparini/repos","events_url":"https://api.github.com/users/felipegasparini/events{/privacy}","received_events_url":"https://api.github.com/users/felipegasparini/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T22:02:40Z","updated_at":"2016-11-03T22:02:40Z","body":"There is another UX issue that I want to discuss.\r\n\r\nIn a previous comment was said that when the card is open for the first time, it should display the cached result (if available) and if the user hits the Refresh button it will triggers the query. This is the approach that I think is more reasonable, but for questions with variables it doesn't work very well. In my opinion, it is desired to use a cached result if it is still valid for a given query + variable values, but if the Refresh should always ignore the cache this behavior will not be possible when \"playing\" with variables.\r\n\r\nAny suggestion for this issue? I can't think in a solution without adding a flag to explicit ignore to cache, but it is not elegant/cool. =/"}}
{"actor":{"display_login":"felipegasparini"}}