{"action":"created","issue":{"url":"https://api.github.com/repos/gitcoinco/web/issues/1278","repository_url":"https://api.github.com/repos/gitcoinco/web","labels_url":"https://api.github.com/repos/gitcoinco/web/issues/1278/labels{/name}","comments_url":"https://api.github.com/repos/gitcoinco/web/issues/1278/comments","events_url":"https://api.github.com/repos/gitcoinco/web/issues/1278/events","html_url":"https://github.com/gitcoinco/web/issues/1278","id":326668569,"node_id":"MDU6SXNzdWUzMjY2Njg1Njk=","number":1278,"title":"prune DB size","user":{"login":"owocki","id":513929,"node_id":"MDQ6VXNlcjUxMzkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/513929?v=4","gravatar_id":"","url":"https://api.github.com/users/owocki","html_url":"https://github.com/owocki","followers_url":"https://api.github.com/users/owocki/followers","following_url":"https://api.github.com/users/owocki/following{/other_user}","gists_url":"https://api.github.com/users/owocki/gists{/gist_id}","starred_url":"https://api.github.com/users/owocki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owocki/subscriptions","organizations_url":"https://api.github.com/users/owocki/orgs","repos_url":"https://api.github.com/users/owocki/repos","events_url":"https://api.github.com/users/owocki/events{/privacy}","received_events_url":"https://api.github.com/users/owocki/received_events","type":"User","site_admin":false},"labels":[{"id":820451824,"node_id":"MDU6TGFiZWw4MjA0NTE4MjQ=","url":"https://api.github.com/repos/gitcoinco/web/labels/in%20progress","name":"in progress","color":"4abc40","default":false}],"state":"open","locked":false,"assignee":{"login":"owocki","id":513929,"node_id":"MDQ6VXNlcjUxMzkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/513929?v=4","gravatar_id":"","url":"https://api.github.com/users/owocki","html_url":"https://github.com/owocki","followers_url":"https://api.github.com/users/owocki/followers","following_url":"https://api.github.com/users/owocki/following{/other_user}","gists_url":"https://api.github.com/users/owocki/gists{/gist_id}","starred_url":"https://api.github.com/users/owocki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owocki/subscriptions","organizations_url":"https://api.github.com/users/owocki/orgs","repos_url":"https://api.github.com/users/owocki/repos","events_url":"https://api.github.com/users/owocki/events{/privacy}","received_events_url":"https://api.github.com/users/owocki/received_events","type":"User","site_admin":false},"assignees":[{"login":"owocki","id":513929,"node_id":"MDQ6VXNlcjUxMzkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/513929?v=4","gravatar_id":"","url":"https://api.github.com/users/owocki","html_url":"https://github.com/owocki","followers_url":"https://api.github.com/users/owocki/followers","following_url":"https://api.github.com/users/owocki/following{/other_user}","gists_url":"https://api.github.com/users/owocki/gists{/gist_id}","starred_url":"https://api.github.com/users/owocki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owocki/subscriptions","organizations_url":"https://api.github.com/users/owocki/orgs","repos_url":"https://api.github.com/users/owocki/repos","events_url":"https://api.github.com/users/owocki/events{/privacy}","received_events_url":"https://api.github.com/users/owocki/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2018-05-25T21:25:34Z","updated_at":"2018-06-01T18:38:25Z","closed_at":null,"author_association":"MEMBER","body":"prod db is up to 800 MB\r\n\r\nhere is a profile of what the db footprint is\r\n\r\n\r\n```\r\nSELECT *, pg_size_pretty(total_bytes) AS total\r\n    , pg_size_pretty(index_bytes) AS INDEX\r\n    , pg_size_pretty(toast_bytes) AS toast\r\n    , pg_size_pretty(table_bytes) AS TABLE\r\n  FROM (\r\n  SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM (\r\n      SELECT c.oid,nspname AS table_schema, relname AS TABLE_NAME\r\n              , c.reltuples AS row_estimate\r\n              , pg_total_relation_size(c.oid) AS total_bytes\r\n              , pg_indexes_size(c.oid) AS index_bytes\r\n              , pg_total_relation_size(reltoastrelid) AS toast_bytes\r\n          FROM pg_class c\r\n          LEFT JOIN pg_namespace n ON n.oid = c.relnamespace\r\n          WHERE relkind = 'r'\r\n  ) a\r\n) a order by total_bytes desc;\r\n```\r\n\r\nyields \r\n\r\n```\r\n oid   |    table_schema    |                table_name                 | row_estimate | total_bytes | index_bytes | toast_bytes | table_bytes |   total    |   index    |   toast    |   table\r\n--------+--------------------+-------------------------------------------+--------------+-------------+-------------+-------------+-------------+------------+------------+------------+------------\r\n 369700 | public             | marketing_stat                            |  1.25765e+06 |   363880448 |   252207104 |             |   111673344 | 347 MB     | 241 MB     |            | 107 MB\r\n 369634 | public             | marketing_emailevent                      |       517689 |   330588160 |    98304000 |        8192 |   232275968 | 315 MB     | 94 MB      | 8192 bytes | 222 MB\r\n 369408 | public             | dashboard_profile                         |         4048 |    91578368 |     1327104 |    85794816 |     4456448 | 87 MB      | 1296 kB    | 82 MB      | 4352 kB\r\n 369527 | public             | economy_conversionrate                    |        88251 |    34045952 |    24027136 |             |    10018816 | 32 MB      | 23 MB      |            | 9784 kB\r\n 369358 | public             | dashboard_bounty                          |         3081 |    22192128 |     2965504 |     9805824 |     9420800 | 21 MB      | 2896 kB    | 9576 kB    | 9200 kB\r\n 369650 | public             | marketing_githubevent                     |         6880 |    20324352 |      516096 |    14106624 |     5701632 | 19 MB      | 504 kB     | 13 MB      | 5568 kB\r\n 369687 | public             | marketing_slackpresence                   |        77781 |    10625024 |     5283840 |             |     5341184 | 10 MB      | 5160 kB    |            | 5216 kB\r\n 369605 | public             | gas_gasprofile                            |        58080 |     9756672 |     5275648 |             |     4481024 | 9528 kB    | 5152 kB    |            | 4376 kB\r\n 369671 | public             | marketing_leaderboardrank                 |        35627 |     5414912 |     1638400 |        8192 |     3768320 | 5288 kB    | 1600 kB    | 8192 bytes | 3680 kB\r\n 369692 | public             | marketing_slackuser                       |         3136 |     5316608 |      180224 |        8192 |     5128192 | 5192 kB    | 176 kB     | 8192 bytes | 5008 kB\r\n 369578 | public             | external_bounties_externalbounty          |         3045 |     4448256 |      548864 |     1581056 |     2318336 | 4344 kB    | 536 kB     | 1544 kB    | 2264 kB\r\n 369642 | public             | marketing_emailsubscriber                 |         5781 |     3121152 |      966656 |        8192 |     2146304 | 3048 kB    | 944 kB     | 8192 bytes | 2096 kB\r\n   2608 | pg_catalog         | pg_depend                                 |         8320 |     2146304 |     1441792 |             |      704512 | 2096 kB    | 1408 kB    |            | 688 kB\r\n   1249 | pg_catalog         | pg_attribute                              |         4774 |     1769472 |      655360 |             |     1114112 | 1728 kB    | 640 kB     |            | 1088 kB\r\n   2619 | pg_catalog         | pg_statistic                              |          784 |     1679360 |       81920 |      991232 |      606208 | 1640 kB    | 80 kB      | 968 kB     | 592 kB\r\n 369450 | public             | dashboard_useraction                      |         4442 |     1556480 |      507904 |        8192 |     1040384 | 1520 kB    | 496 kB     | 8192 bytes | 1016 kB\r\n 369488 | public             | django_session                            |         2563 |     1269760 |      425984 |        8192 |      835584 | 1240 kB    | 416 kB     | 8192 bytes | 816 kB\r\n   1255 | pg_catalog         | pg_proc                                   |         2894 |      999424 |      352256 |        8192 |      638976 | 976 kB     | 344 kB     | 8192 bytes | 624 kB\r\n   1259 | pg_catalog         | pg_class                                  |          787 |      630784 |      385024 |             |      245760 | 616 kB     | 376 kB     |            | 240 kB\r\n   2618 | pg_catalog         | pg_rewrite                                |          121 |      630784 |       32768 |      466944 |      131072 | 616 kB     | 32 kB      | 456 kB     | 128 kB\r\n 369379 | public             | dashboard_bountysyncrequest               |         3166 |      548864 |      180224 |             |      368640 | 536 kB     | 176 kB     |            | 360 kB\r\n 369371 | public             | dashboard_bountyfulfillment               |          672 |      540672 |      131072 |        8192 |      401408 | 528 kB     | 128 kB     | 8192 bytes | 392 kB\r\n   2609 | pg_catalog         | pg_description                            |         3924 |      507904 |      180224 |        8192 |      319488 | 496 kB     | 176 kB     | 8192 bytes | 312 kB\r\n 369618 | public             | linkshortener_link                        |         1250 |      393216 |      212992 |        8192 |      172032 | 384 kB     | 208 kB     | 8192 bytes | 168 kB\r\n   1247 | pg_catalog         | pg_type                                   |          605 |      360448 |      163840 |             |      196608 | 352 kB     | 160 kB     |            | 192 kB\r\n 369384 | public             | dashboard_coinredemption                  |         1201 |      344064 |       98304 |        8192 |      237568 | 336 kB     | 96 kB      | 8192 bytes | 232 kB\r\n 369738 | public             | social_auth_usersocialauth                |          771 |      344064 |      122880 |        8192 |      212992 | 336 kB     | 120 kB     | 8192 bytes | 208 kB\r\n   2610 | pg_catalog         | pg_index                                  |          387 |      294912 |      139264 |             |      155648 | 288 kB     | 136 kB     |            | 152 kB\r\n 369340 | public             | auth_user                                 |          782 |      270336 |      122880 |        8192 |      139264 | 264 kB     | 120 kB     | 8192 bytes | 136 kB\r\n   2617 | pg_catalog         | pg_operator                               |          787 |      245760 |       90112 |             |      155648 | 240 kB     | 88 kB      |            | 152 kB\r\n 369366 | public             | dashboard_bounty_interested               |         1014 |      237568 |      163840 |             |       73728 | 232 kB     | 160 kB     |            | 72 kB\r\n 369466 | public             | django_admin_log                          |          550 |      229376 |      114688 |        8192 |      106496 | 224 kB     | 112 kB     | 8192 bytes | 104 kB\r\n 369424 | public             | dashboard_tip                             |          189 |      221184 |       65536 |        8192 |      147456 | 216 kB     | 64 kB      | 8192 bytes | 144 kB\r\n 369705 | public             | my_cache_table                            |          261 |      212992 |       57344 |       24576 |      131072 | 208 kB     | 56 kB      | 24 kB      | 128 kB\r\n 369679 | public             | marketing_match                           |          631 |      196608 |       98304 |        8192 |       90112 | 192 kB     | 96 kB      | 8192 bytes | 88 kB\r\n   2606 | pg_catalog         | pg_constraint                             |           96 |      196608 |       98304 |        8192 |       90112 | 192 kB     | 96 kB      | 8192 bytes | 88 kB\r\n   2602 | pg_catalog         | pg_amop                                   |          709 |      196608 |      114688 |             |       81920 | 192 kB     | 112 kB     |            | 80 kB\r\n 369757 | public             | tdi_whitepaperaccessrequest               |          384 |      188416 |       65536 |        8192 |      114688 | 184 kB     | 64 kB      | 8192 bytes | 112 kB\r\n   2620 | pg_catalog         | pg_trigger                                |          160 |      172032 |      106496 |        8192 |       57344 | 168 kB     | 104 kB     | 8192 bytes | 56 kB\r\n 369504 | public             | easy_thumbnails_thumbnail                 |           74 |      172032 |      131072 |             |       40960 | 168 kB     | 128 kB     |            | 40 kB\r\n```\r\n\r\nwe may want to prune down the \r\n* marketing_stat table\r\n* marketing_emailevent table\r\n* marketing_githubevent tables\r\n* economy_conversionrate table"},"comment":{"url":"https://api.github.com/repos/gitcoinco/web/issues/comments/393972854","html_url":"https://github.com/gitcoinco/web/issues/1278#issuecomment-393972854","issue_url":"https://api.github.com/repos/gitcoinco/web/issues/1278","id":393972854,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Mzk3Mjg1NA==","user":{"login":"owocki","id":513929,"node_id":"MDQ6VXNlcjUxMzkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/513929?v=4","gravatar_id":"","url":"https://api.github.com/users/owocki","html_url":"https://github.com/owocki","followers_url":"https://api.github.com/users/owocki/followers","following_url":"https://api.github.com/users/owocki/following{/other_user}","gists_url":"https://api.github.com/users/owocki/gists{/gist_id}","starred_url":"https://api.github.com/users/owocki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owocki/subscriptions","organizations_url":"https://api.github.com/users/owocki/orgs","repos_url":"https://api.github.com/users/owocki/repos","events_url":"https://api.github.com/users/owocki/events{/privacy}","received_events_url":"https://api.github.com/users/owocki/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T18:38:25Z","updated_at":"2018-06-01T18:38:25Z","author_association":"MEMBER","body":"looks like they are drops and deferrals \r\n\r\n```\r\n\r\nIn [14]: EmailEvent.objects.order_by('-pk')[0]\r\nOut[14]: <EmailEvent: email_logger@gitcoin.co - deferred - 2018-06-01 18:37:36+00:00>\r\n\r\nIn [15]: EmailEvent.objects.order_by('-pk')[2]\r\nOut[15]: <EmailEvent: =?utf-8?q?e?=@none - dropped - 2018-06-01 18:37:56+00:00>\r\n\r\nIn [16]: EmailEvent.objects.order_by('-pk')[3]\r\nOut[16]: <EmailEvent: email_logger@gitcoin.co - deferred - 2018-06-01 18:37:42+00:00>\r\n\r\nIn [17]: EmailEvent.objects.order_by('-pk')[4]\r\nOut[17]: <EmailEvent: email_logger@gitcoin.co - deferred - 2018-06-01 18:38:06+00:00>\r\n\r\nIn [18]: EmailEvent.objects.order_by('-pk')[5]\r\nOut[18]: <EmailEvent: email_logger@gitcoin.co - deferred - 2018-06-01 18:38:06+00:00>\r\n\r\nIn [19]: EmailEvent.objects.order_by('-pk')[6]\r\nOut[19]: <EmailEvent: email_logger@gitcoin.co - deferred - 2018-06-01 18:37:52+00:00>\r\n\r\n```"}}
{"actor":{"display_login":"owocki"}}