{"action":"created","issue":{"url":"https://api.github.com/repos/opencaching/opencaching-pl/issues/1394","repository_url":"https://api.github.com/repos/opencaching/opencaching-pl","labels_url":"https://api.github.com/repos/opencaching/opencaching-pl/issues/1394/labels{/name}","comments_url":"https://api.github.com/repos/opencaching/opencaching-pl/issues/1394/comments","events_url":"https://api.github.com/repos/opencaching/opencaching-pl/issues/1394/events","html_url":"https://github.com/opencaching/opencaching-pl/issues/1394","id":294683651,"number":1394,"title":"Unused tables in db","user":{"login":"rapotek","id":17698165,"avatar_url":"https://avatars0.githubusercontent.com/u/17698165?v=4","gravatar_id":"","url":"https://api.github.com/users/rapotek","html_url":"https://github.com/rapotek","followers_url":"https://api.github.com/users/rapotek/followers","following_url":"https://api.github.com/users/rapotek/following{/other_user}","gists_url":"https://api.github.com/users/rapotek/gists{/gist_id}","starred_url":"https://api.github.com/users/rapotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapotek/subscriptions","organizations_url":"https://api.github.com/users/rapotek/orgs","repos_url":"https://api.github.com/users/rapotek/repos","events_url":"https://api.github.com/users/rapotek/events{/privacy}","received_events_url":"https://api.github.com/users/rapotek/received_events","type":"User","site_admin":false},"labels":[{"id":239148128,"url":"https://api.github.com/repos/opencaching/opencaching-pl/labels/Component_DataBase","name":"Component_DataBase","color":"c7def8","default":false},{"id":336557873,"url":"https://api.github.com/repos/opencaching/opencaching-pl/labels/General_Discussion","name":"General_Discussion","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-06T09:16:58Z","updated_at":"2018-02-07T07:46:26Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I've made a simple analysis, lexical and contextless, on db tables usage in code, based on current master contents and opencaching.pl dbstruct dump. The results are:\r\n\r\n1. Total number of tables: 132\r\n1. Number of tables used and updated in code: 89\r\n1. Number of tables used but not updated in code: 20, in details:\r\n\r\n| Table | Remarks |\r\n| --- | --- |\r\n| cache_attrib | important! keep it! |\r\n| cache_coordinates | should be migrated into caches table |\r\n| cache_countries | should be migrated into caches table |\r\n| cache_size | can be migrated into GeoCache object constans |\r\n| cache_status | can be migrated into GeoCache object constans |\r\n| cache_type |  can be migrated into GeoCache object constans |\r\n| countries ||\r\n| email_schemas |  important! keep it! |\r\n| geodb_coordinates | see issue #1148 |\r\n| geodb_hierarchies | see issue #1148 |\r\n| geodb_textdata | see issue #1148 |\r\n| languages ||\r\n| log_types | can be migrated into GeoCacheLog object constans |\r\n| log_types_text | can be migrated into GeoCacheLog object constans |\r\n| nuts_layer | data updates in README instruction |\r\n| parkipl | code for parkipl is unused for years |\r\n| search_ignore ||\r\n| statpics |  important! keep it! |\r\n| user_finds | could be removed after code refactor |\r\n| waypoint_type |  important! keep it!  |\r\n\r\n4. Number of tables used in triggers only: 1 (powertrail_progress)\r\n4. Number of tables occurring in sqlAlters only: 1 (badge_area)\r\n4. Number of tables not used in code: 21, in details:\r\ncache_visits\r\ngeodb_areas\r\ngeodb_changelog\r\ngeodb_floatdata\r\ngeodb_intdata\r\ngeodb_locations\r\ngeodb_polygons\r\ngeodb_search\r\ngeodb_type_names\r\ngk_item_type\r\ngk_move\r\ngk_move_type\r\ngk_move_waypoint\r\ngk_user\r\nimport_caches_date\r\nlogentries_types\r\npds_send\r\npds_was_sent\r\nsearch_words\r\ntransaction_test\r\nwatches_waitingtypes\r\n\r\nAs I mentioned already, the code itself was not analysed, only table names occurrences searched. Please verify the point 6 especially if listed tables are not used at all, even by external tools. If not, I think they are ready to drop.\r\n\r\nSome tables are used in `/xml/ocxml11.php' file only. What is the purpose of this file?"},"comment":{"url":"https://api.github.com/repos/opencaching/opencaching-pl/issues/comments/363684147","html_url":"https://github.com/opencaching/opencaching-pl/issues/1394#issuecomment-363684147","issue_url":"https://api.github.com/repos/opencaching/opencaching-pl/issues/1394","id":363684147,"user":{"login":"rapotek","id":17698165,"avatar_url":"https://avatars0.githubusercontent.com/u/17698165?v=4","gravatar_id":"","url":"https://api.github.com/users/rapotek","html_url":"https://github.com/rapotek","followers_url":"https://api.github.com/users/rapotek/followers","following_url":"https://api.github.com/users/rapotek/following{/other_user}","gists_url":"https://api.github.com/users/rapotek/gists{/gist_id}","starred_url":"https://api.github.com/users/rapotek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapotek/subscriptions","organizations_url":"https://api.github.com/users/rapotek/orgs","repos_url":"https://api.github.com/users/rapotek/repos","events_url":"https://api.github.com/users/rapotek/events{/privacy}","received_events_url":"https://api.github.com/users/rapotek/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T07:46:26Z","updated_at":"2018-02-07T07:46:26Z","author_association":"CONTRIBUTOR","body":"@kojoty zrobić nowy dokument uaktualniając ten stary, ale nie w google docs, tylko w githubie w docs, żeby każdy go miał, mógł dodawać poprawki i było widać jego historię. Nawet, żeby można było bezpiecznie odnieść się do niego w wiki.\r\n\r\nStworzyłem ten temat (nie wiedząc zresztą o poprzednich), bo wygląda na to, że można bazę danych \"odchudzić\", jeżeli nie objętościowo, to przynajmniej konstrukcyjnie.\r\n\r\nTo, co jest potrzebne w pierwszym rzucie, to potwierdzenie, że na żadnym z nodów tabele \"do usunięcia\" faktycznie nie są używane ani w kodzie ani w żadnych zewnętrznych narzędziach.\r\n\r\nW przypadku tabel \"tylko odczytywanych\" przed rozpoczęciem planowania przeniesienia ich zawartości do kodu trzeba sprawdzić, czy ta zawartość na wszystkich nodach jest identyczna. Jeżeli nie, to danej tabeli ruszyć nie można. Ze swojej strony mogę spróbować zrobić zestawienie wszystkich miejsc, w których dana tabela jest odczytywana.\r\n\r\nJuż teraz widzę, że zrobiłem błędy, gdyż nie uwzględniłem w wyszukiwaniu triggerów już istniejących w deweloperskiej bazie, stąd np. `cache_coordinates` i `cache_countries` są aktualizowane ale przy pomocy triggerów."}}
{"actor":{"display_login":"rapotek"}}